Class OAuth2Util.AuthSession

  • Enclosing class:
    OAuth2Util

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

      • AuthSession

        public AuthSession​(java.util.Map<java.lang.String,​java.lang.String> baseHeaders,
                           AuthConfig config)
    • 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()
      • expiresAtMillis

        public java.lang.Long expiresAtMillis()
      • scope

        public java.lang.String scope()
      • stopRefreshing

        public void stopRefreshing()
      • credential

        public java.lang.String credential()
      • oauth2ServerUri

        public java.lang.String oauth2ServerUri()
      • optionalOAuthParams

        public java.util.Map<java.lang.String,​java.lang.String> optionalOAuthParams()
      • 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