public static class OAuth2Authorization.Token<T extends org.springframework.security.oauth2.core.OAuth2Token>
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLAIMS_METADATA_NAME
The name of the metadata used for the claims of the token.
|
static java.lang.String |
INVALIDATED_METADATA_NAME
The name of the metadata that indicates if the token has been invalidated.
|
protected static java.lang.String |
TOKEN_METADATA_NAMESPACE |
| Modifier | Constructor and Description |
|---|---|
protected |
Token(T token) |
protected |
Token(T token,
java.util.Map<java.lang.String,java.lang.Object> metadata) |
| Modifier and Type | Method and Description |
|---|---|
protected static java.util.Map<java.lang.String,java.lang.Object> |
defaultMetadata() |
boolean |
equals(java.lang.Object obj) |
java.util.Map<java.lang.String,java.lang.Object> |
getClaims()
Returns the claims associated to the token.
|
java.util.Map<java.lang.String,java.lang.Object> |
getMetadata()
Returns the metadata associated to the token.
|
<V> V |
getMetadata(java.lang.String name)
Returns the value of the metadata associated to the token.
|
T |
getToken()
Returns the token of type
OAuth2Token. |
int |
hashCode() |
boolean |
isActive()
Returns
true if the token is currently active. |
boolean |
isBeforeUse()
Returns
true if the token is before the time it can be used. |
boolean |
isExpired()
Returns
true if the token has expired. |
boolean |
isInvalidated()
Returns
true if the token has been invalidated (e.g. |
protected static final java.lang.String TOKEN_METADATA_NAMESPACE
public static final java.lang.String INVALIDATED_METADATA_NAME
public static final java.lang.String CLAIMS_METADATA_NAME
protected Token(T token)
protected Token(T token, java.util.Map<java.lang.String,java.lang.Object> metadata)
public T getToken()
OAuth2Token.OAuth2Tokenpublic boolean isInvalidated()
true if the token has been invalidated (e.g. revoked).
The default is false.true if the token has been invalidated, false otherwisepublic boolean isExpired()
true if the token has expired.true if the token has expired, false otherwisepublic boolean isBeforeUse()
true if the token is before the time it can be used.true if the token is before the time it can be used, false otherwisepublic boolean isActive()
true if the token is currently active.true if the token is currently active, false otherwise@Nullable public java.util.Map<java.lang.String,java.lang.Object> getClaims()
Map of the claims, or null if not available@Nullable public <V> V getMetadata(java.lang.String name)
V - the value type of the metadataname - the name of the metadatanull if not availablepublic java.util.Map<java.lang.String,java.lang.Object> getMetadata()
Map of the metadataprotected static java.util.Map<java.lang.String,java.lang.Object> defaultMetadata()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object