Class OAuth2RefreshToken
java.lang.Object
org.springframework.security.oauth2.core.AbstractOAuth2Token
org.springframework.security.oauth2.core.OAuth2RefreshToken
africa.absa.inception.oauth2.server.authorization.token.OAuth2RefreshToken
- All Implemented Interfaces:
Serializable,org.springframework.security.oauth2.core.OAuth2Token
public class OAuth2RefreshToken
extends org.springframework.security.oauth2.core.OAuth2RefreshToken
The OAuth2RefreshToken class holds the information for an OAuth2 refresh token.
- Author:
- Marcus Portmann
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOAuth2RefreshToken(String tokenValue, Instant issuedAt) Constructs a new OAuth2RefreshToken. -
Method Summary
Modifier and TypeMethodDescriptionstatic OAuth2RefreshTokenbuild(String username, Set<String> scopes, int validFor, RSAPrivateKey rsaPrivateKey) Build a new OAuth2RefreshToken.Methods inherited from class org.springframework.security.oauth2.core.AbstractOAuth2Token
equals, getExpiresAt, getIssuedAt, getTokenValue, hashCode
-
Field Details
-
SCOPE_CLAIM
The name of the scope claim.- See Also:
-
-
Constructor Details
-
OAuth2RefreshToken
Constructs a new OAuth2RefreshToken.- Parameters:
tokenValue- the token valueissuedAt- the time at which the token was issued
-
-
Method Details
-
build
public static OAuth2RefreshToken build(String username, Set<String> scopes, int validFor, RSAPrivateKey rsaPrivateKey) Build a new OAuth2RefreshToken.- Parameters:
username- the username for the user the token is being issued forscopes- the optional scope(s) associated to the tokenvalidFor- the number of seconds the token should be valid forrsaPrivateKey- the RSA private key used to sign the token- Returns:
- the OAuth2 refresh token
-