Class OAuth2Util.AuthSession

  • Enclosing class:

    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,
                           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.
        client - a RESTClient
        interval to wait before calling refresh again, or null if no refresh is needed