Class TokenResponse
java.lang.Object
io.micronaut.security.oauth2.endpoint.token.response.TokenResponse
- Direct Known Subclasses:
OpenIdTokenResponse
Represent the response of an authorization server to a valid access token request.
- Since:
- 1.2.0
- Author:
- Sergio del Amo
- See Also:
-
Constructor Summary
ConstructorDescriptionInstantiates Access Token Response.TokenResponse
(@NonNull String accessToken, @NonNull String tokenType) Instantiates Access Token Response. -
Method Summary
Modifier and TypeMethodDescriptionboolean
@NonNull String
@Nullable Integer
@Nullable String
@Nullable String
getScope()
@NonNull String
int
hashCode()
void
setAccessToken
(@NonNull String accessToken) void
setExpiresIn
(@Nullable Integer expiresIn) void
setRefreshToken
(@Nullable String refreshToken) void
void
setTokenType
(@NonNull String tokenType)
-
Constructor Details
-
TokenResponse
public TokenResponse()Instantiates Access Token Response. -
TokenResponse
Instantiates Access Token Response.- Parameters:
accessToken
- Access token issued by the authorization server.tokenType
- The type of the token issued.
-
-
Method Details
-
getAccessToken
- Returns:
- The access token issued by the authorization server.
-
setAccessToken
- Parameters:
accessToken
- The access token issued by the authorization server.
-
getTokenType
- Returns:
- The type of the token issued.
-
setTokenType
- Parameters:
tokenType
- The type of the token issued.
-
getExpiresIn
- Returns:
- The lifetime in seconds of the access token.
-
setExpiresIn
- Parameters:
expiresIn
- The lifetime in seconds of the access token.
-
getExpiresInDate
- Returns:
- Expiration date of the access token. Calculated with the
expiresIn
received by the authorization server.
-
getScope
- Returns:
- Scope of the access token.
-
setScope
- Parameters:
scope
- Scope of the access token.
-
getRefreshToken
- Returns:
- The refresh token, which can be used to obtain new access tokens using the same authorization grant.
-
setRefreshToken
- Parameters:
refreshToken
- The refresh token, which can be used to obtain new access tokens using the same authorization grant.
-
equals
-
hashCode
public int hashCode()
-