Class OAuth2Authorization.Token<T extends org.springframework.security.oauth2.core.OAuth2Token>
java.lang.Object
org.springframework.security.oauth2.server.authorization.OAuth2Authorization.Token<T>
- Type Parameters:
T- the type of theOAuth2Token
- All Implemented Interfaces:
Serializable
- Enclosing class:
- OAuth2Authorization
public static class OAuth2Authorization.Token<T extends org.springframework.security.oauth2.core.OAuth2Token>
extends Object
implements Serializable
A holder of an OAuth 2.0 Token and it's associated metadata.
- Since:
- 0.1.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the claims associated to the token.Returns the metadata associated to the token.<V> VgetMetadata(String name) Returns the value of the metadata associated to the token.getToken()Returns the token of typeOAuth2Token.inthashCode()booleanisActive()Returnstrueif the token is currently active.booleanReturnstrueif the token is before the time it can be used.booleanReturnstrueif the token has expired.booleanReturnstrueif the token has been invalidated (e.g.
-
Field Details
-
TOKEN_METADATA_NAMESPACE
- See Also:
-
INVALIDATED_METADATA_NAME
The name of the metadata that indicates if the token has been invalidated. -
CLAIMS_METADATA_NAME
The name of the metadata used for the claims of the token.
-
-
Constructor Details
-
Token
-
Token
-
-
Method Details
-
getToken
Returns the token of typeOAuth2Token.- Returns:
- the token of type
OAuth2Token
-
isInvalidated
public boolean isInvalidated()Returnstrueif the token has been invalidated (e.g. revoked). The default isfalse.- Returns:
trueif the token has been invalidated,falseotherwise
-
isExpired
public boolean isExpired()Returnstrueif the token has expired.- Returns:
trueif the token has expired,falseotherwise
-
isBeforeUse
public boolean isBeforeUse()Returnstrueif the token is before the time it can be used.- Returns:
trueif the token is before the time it can be used,falseotherwise
-
isActive
public boolean isActive()Returnstrueif the token is currently active.- Returns:
trueif the token is currently active,falseotherwise
-
getClaims
Returns the claims associated to the token.- Returns:
- a
Mapof the claims, ornullif not available
-
getMetadata
Returns the value of the metadata associated to the token.- Type Parameters:
V- the value type of the metadata- Parameters:
name- the name of the metadata- Returns:
- the value of the metadata, or
nullif not available
-
getMetadata
Returns the metadata associated to the token.- Returns:
- a
Mapof the metadata
-
defaultMetadata
-
equals
-
hashCode
public int hashCode()
-