Class OAuthToken
- java.lang.Object
-
- com.ibm.websphere.security.oauth20.store.OAuthToken
-
public class OAuthToken extends java.lang.ObjectAn OAuth token implementation used for storing or retrieving entries from anOAuthStoreimplementation.
-
-
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 newOAuthTokendata transfer object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetClientId()Gets the client id.longgetCreatedAt()Gets the time the token was created at.longgetExpires()Gets the time the token expires.intgetLifetimeInSeconds()Gets the token lifetime.java.lang.StringgetLookupKey()Gets the lookup key.java.lang.StringgetProviderId()Gets the OAuth provider id.java.lang.StringgetRedirectUri()Gets the redirect URI.java.lang.StringgetScope()Gets the token scope.java.lang.StringgetStateId()Gets the state id.java.lang.StringgetSubType()Gets the token sub type.java.lang.StringgetTokenProperties()Gets the token extension properties as a JSON string.java.lang.StringgetTokenString()Gets the encoded token string.java.lang.StringgetType()Gets the token type.java.lang.StringgetUniqueId()Gets the unique id.java.lang.StringgetUsername()Gets the user name.inthashCode()
-
-
-
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 newOAuthTokendata 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-