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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the claims associated to the token.Returns the metadata associated to the token.<V> V
getMetadata
(String name) Returns the value of the metadata associated to the token.getToken()
Returns the token of typeOAuth2Token
.int
hashCode()
boolean
isActive()
Returnstrue
if the token is currently active.boolean
Returnstrue
if the token is before the time it can be used.boolean
Returnstrue
if the token has expired.boolean
Returnstrue
if 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()Returnstrue
if the token has been invalidated (e.g. revoked). The default isfalse
.- Returns:
true
if the token has been invalidated,false
otherwise
-
isExpired
public boolean isExpired()Returnstrue
if the token has expired.- Returns:
true
if the token has expired,false
otherwise
-
isBeforeUse
public boolean isBeforeUse()Returnstrue
if the token is before the time it can be used.- Returns:
true
if the token is before the time it can be used,false
otherwise
-
isActive
public boolean isActive()Returnstrue
if the token is currently active.- Returns:
true
if the token is currently active,false
otherwise
-
getClaims
Returns the claims associated to the token.- Returns:
- a
Map
of the claims, ornull
if 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
null
if not available
-
getMetadata
Returns the metadata associated to the token.- Returns:
- a
Map
of the metadata
-
defaultMetadata
-
equals
-
hashCode
public int hashCode()
-