Class AbstractOAuth2Token
java.lang.Object
org.springframework.security.oauth2.core.AbstractOAuth2Token
- All Implemented Interfaces:
Serializable
,OAuth2Token
- Direct Known Subclasses:
Jwt
,OAuth2AccessToken
,OAuth2DeviceCode
,OAuth2RefreshToken
,OAuth2UserCode
,OidcIdToken
,OidcLogoutToken
Base class for OAuth 2.0 Token implementations.
- Since:
- 5.0
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractOAuth2Token
(String tokenValue) Sub-class constructor.protected
AbstractOAuth2Token
(String tokenValue, Instant issuedAt, Instant expiresAt) Sub-class constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the expiration time on or after which the token MUST NOT be accepted.Returns the time at which the token was issued.Returns the token value.int
hashCode()
-
Constructor Details
-
AbstractOAuth2Token
Sub-class constructor.- Parameters:
tokenValue
- the token value
-
AbstractOAuth2Token
protected AbstractOAuth2Token(String tokenValue, @Nullable Instant issuedAt, @Nullable Instant expiresAt) Sub-class constructor.- Parameters:
tokenValue
- the token valueissuedAt
- the time at which the token was issued, may benull
expiresAt
- the expiration time on or after which the token MUST NOT be accepted, may benull
-
-
Method Details
-
getTokenValue
Returns the token value.- Specified by:
getTokenValue
in interfaceOAuth2Token
- Returns:
- the token value
-
getIssuedAt
Returns the time at which the token was issued.- Specified by:
getIssuedAt
in interfaceOAuth2Token
- Returns:
- the time the token was issued or
null
-
getExpiresAt
Returns the expiration time on or after which the token MUST NOT be accepted.- Specified by:
getExpiresAt
in interfaceOAuth2Token
- Returns:
- the token expiration time or
null
-
equals
-
hashCode
public int hashCode()
-