Class AbstractOAuth2Token
- java.lang.Object
-
- org.springframework.security.oauth2.core.AbstractOAuth2Token
-
- All Implemented Interfaces:
java.io.Serializable,OAuth2Token
- Direct Known Subclasses:
Jwt,OAuth2AccessToken,OAuth2RefreshToken,OidcIdToken
public abstract class AbstractOAuth2Token extends java.lang.Object implements OAuth2Token, java.io.Serializable
Base class for OAuth 2.0 Token implementations.- Since:
- 5.0
- See Also:
OAuth2Token,OAuth2AccessToken,OAuth2RefreshToken, Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractOAuth2Token(java.lang.String tokenValue)Sub-class constructor.protectedAbstractOAuth2Token(java.lang.String tokenValue, java.time.Instant issuedAt, java.time.Instant expiresAt)Sub-class constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.time.InstantgetExpiresAt()Returns the expiration time on or after which the token MUST NOT be accepted.java.time.InstantgetIssuedAt()Returns the time at which the token was issued.java.lang.StringgetTokenValue()Returns the token value.inthashCode()
-
-
-
Constructor Detail
-
AbstractOAuth2Token
protected AbstractOAuth2Token(java.lang.String tokenValue)
Sub-class constructor.- Parameters:
tokenValue- the token value
-
AbstractOAuth2Token
protected AbstractOAuth2Token(java.lang.String tokenValue, @Nullable java.time.Instant issuedAt, @Nullable java.time.Instant expiresAt)Sub-class constructor.- Parameters:
tokenValue- the token valueissuedAt- the time at which the token was issued, may benullexpiresAt- the expiration time on or after which the token MUST NOT be accepted, may benull
-
-
Method Detail
-
getTokenValue
public java.lang.String getTokenValue()
Returns the token value.- Specified by:
getTokenValuein interfaceOAuth2Token- Returns:
- the token value
-
getIssuedAt
@Nullable public java.time.Instant getIssuedAt()
Returns the time at which the token was issued.- Specified by:
getIssuedAtin interfaceOAuth2Token- Returns:
- the time the token was issued or
null
-
getExpiresAt
@Nullable public java.time.Instant getExpiresAt()
Returns the expiration time on or after which the token MUST NOT be accepted.- Specified by:
getExpiresAtin interfaceOAuth2Token- Returns:
- the token expiration time or
null
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-