Class OAuth2Util.AuthSession

  • Enclosing class:
    OAuth2Util

    public static class OAuth2Util.AuthSession
    extends java.lang.Object
    Class to handle authorization headers and token refresh.
    • Constructor Summary

      Constructors 
      Constructor Description
      AuthSession​(java.util.Map<java.lang.String,​java.lang.String> baseHeaders, java.lang.String token, java.lang.String tokenType)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.String> headers()  
      Pair<java.lang.Integer,​java.util.concurrent.TimeUnit> refresh​(RESTClient client)
      Attempt to refresh the session token using the token exchange flow.
      void stopRefreshing()  
      java.lang.String token()  
      java.lang.String tokenType()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AuthSession

        public AuthSession​(java.util.Map<java.lang.String,​java.lang.String> baseHeaders,
                           java.lang.String token,
                           java.lang.String tokenType)
    • Method Detail

      • headers

        public java.util.Map<java.lang.String,​java.lang.String> headers()
      • token

        public java.lang.String token()
      • tokenType

        public java.lang.String tokenType()
      • stopRefreshing

        public void stopRefreshing()
      • refresh

        public Pair<java.lang.Integer,​java.util.concurrent.TimeUnit> refresh​(RESTClient client)
        Attempt to refresh the session token using the token exchange flow.
        Parameters:
        client - a RESTClient
        Returns:
        interval to wait before calling refresh again, or null if no refresh is needed