Class OAuthToken


  • public class OAuthToken
    extends java.lang.Object
    An OAuth token implementation used for storing or retrieving entries from an OAuthStore implementation.
    • Constructor Summary

      Constructors 
      Constructor Description
      OAuthToken​(java.lang.String lookupKey, java.lang.String uniqueId, java.lang.String providerId, java.lang.String type, java.lang.String subType, long createdAt, int lifetimeInSeconds, long expires, java.lang.String tokenString, java.lang.String clientId, java.lang.String username, java.lang.String scope, java.lang.String redirectUri, java.lang.String stateId, java.lang.String tokenProperties)
      Constructs a new OAuthToken data transfer object.
    • Constructor Detail

      • OAuthToken

        public OAuthToken​(java.lang.String lookupKey,
                          java.lang.String uniqueId,
                          java.lang.String providerId,
                          java.lang.String type,
                          java.lang.String subType,
                          long createdAt,
                          int lifetimeInSeconds,
                          long expires,
                          java.lang.String tokenString,
                          java.lang.String clientId,
                          java.lang.String username,
                          java.lang.String scope,
                          java.lang.String redirectUri,
                          java.lang.String stateId,
                          java.lang.String tokenProperties)
        Constructs a new OAuthToken data transfer object.
    • Method Detail

      • getLookupKey

        public java.lang.String getLookupKey()
        Gets the lookup key.
        Returns:
        the lookup key to be used to store the entry in the OAuthStore
      • getUniqueId

        public java.lang.String getUniqueId()
        Gets the unique id.
        Returns:
        the unique id
      • getProviderId

        public java.lang.String getProviderId()
        Gets the OAuth provider id. This id can be used in combination with the lookup key to store the tokens per OAuth provider.
        Returns:
        the id of the OAuth provider that issued the token
      • getType

        public java.lang.String getType()
        Gets the token type.
        Returns:
        the token type, "AUTHORIZATION_GRANT" or "ACCESS_TOKEN" for example
      • getSubType

        public java.lang.String getSubType()
        Gets the token sub type.
        Returns:
        the authorization grant type or access token type, "Code" or "Bearer" for example
      • getCreatedAt

        public long getCreatedAt()
        Gets the time the token was created at.
        Returns:
        the timestamp in milliseconds since the epoch when this token was created
      • getLifetimeInSeconds

        public int getLifetimeInSeconds()
        Gets the token lifetime.
        Returns:
        the lifetime in seconds of this token
      • getExpires

        public long getExpires()
        Gets the time the token expires.
        Returns:
        the timestamp in milliseconds since the epoch when this token expires
      • getTokenString

        public java.lang.String getTokenString()
        Gets the encoded token string.
        Returns:
        the token string
      • getClientId

        public java.lang.String getClientId()
        Gets the client id.
        Returns:
        the id of the client the token was issued to
      • getUsername

        public java.lang.String getUsername()
        Gets the user name.
        Returns:
        the user the token was issued for
      • getScope

        public java.lang.String getScope()
        Gets the token scope.
        Returns:
        the scope values that this token was approved for
      • getRedirectUri

        public java.lang.String getRedirectUri()
        Gets the redirect URI.
        Returns:
        the redirect URI
      • getStateId

        public java.lang.String getStateId()
        Gets the state id.
        Returns:
        the state id
      • getTokenProperties

        public java.lang.String getTokenProperties()
        Gets the token extension properties as a JSON string.
        Returns:
        the JSON string with the token extension properties
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object