Class OAuthToken

java.lang.Object
com.ibm.websphere.security.oauth20.store.OAuthToken

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

    • OAuthToken

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

    • getLookupKey

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

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

      public 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 String getType()
      Gets the token type.
      Returns:
      the token type, "AUTHORIZATION_GRANT" or "ACCESS_TOKEN" for example
    • getSubType

      public 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 String getTokenString()
      Gets the encoded token string.
      Returns:
      the token string
    • getClientId

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

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

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

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

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

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object