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

        @Deprecated
        public AuthSession​(java.util.Map<java.lang.String,​java.lang.String> baseHeaders,
                           java.lang.String token,
                           java.lang.String tokenType)
        Deprecated.
        will be removed in 1.3.0; use AuthSession(Map, String, String, String, String) instead.
      • AuthSession

        public AuthSession​(java.util.Map<java.lang.String,​java.lang.String> baseHeaders,
                           java.lang.String token,
                           java.lang.String tokenType,
                           java.lang.String credential,
                           java.lang.String scope)
    • 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()
      • 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