Class TokenResponse
- java.lang.Object
-
- io.micronaut.security.oauth2.endpoint.token.response.TokenResponse
-
- Direct Known Subclasses:
OpenIdTokenResponse
@Introspected public class TokenResponse extends java.lang.ObjectRepresent the response of an authorization server to a valid access token request.- Since:
- 1.2.0
- See Also:
- RFC 6749 Access Token Successful Response
-
-
Constructor Summary
Constructors Constructor Description TokenResponse()Instantiates Access Token Response.TokenResponse(java.lang.String accessToken, java.lang.String tokenType)Instantiates Access Token Response.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.StringgetAccessToken()java.lang.IntegergetExpiresIn()java.util.Optional<java.util.Date>getExpiresInDate()java.lang.StringgetRefreshToken()java.lang.StringgetScope()java.lang.StringgetTokenType()inthashCode()voidsetAccessToken(java.lang.String accessToken)voidsetExpiresIn(java.lang.Integer expiresIn)voidsetRefreshToken(java.lang.String refreshToken)voidsetScope(java.lang.String scope)voidsetTokenType(java.lang.String tokenType)
-
-
-
Constructor Detail
-
TokenResponse
public TokenResponse()
Instantiates Access Token Response.
-
TokenResponse
public TokenResponse(@NonNull java.lang.String accessToken, @NonNull java.lang.String tokenType)Instantiates Access Token Response.- Parameters:
accessToken- Access token issued by the authorization server.tokenType- The type of the token issued.
-
-
Method Detail
-
getAccessToken
@NonNull public java.lang.String getAccessToken()
- Returns:
- The access token issued by the authorization server.
-
setAccessToken
public void setAccessToken(@NonNull java.lang.String accessToken)- Parameters:
accessToken- The access token issued by the authorization server.
-
getTokenType
@NonNull public java.lang.String getTokenType()
- Returns:
- The type of the token issued.
-
setTokenType
public void setTokenType(@NonNull java.lang.String tokenType)- Parameters:
tokenType- The type of the token issued.
-
getExpiresIn
@Nullable public java.lang.Integer getExpiresIn()
- Returns:
- The lifetime in seconds of the access token.
-
setExpiresIn
public void setExpiresIn(@Nullable java.lang.Integer expiresIn)- Parameters:
expiresIn- The lifetime in seconds of the access token.
-
getExpiresInDate
@NonNull public java.util.Optional<java.util.Date> getExpiresInDate()
- Returns:
- Expiration date of the access token. Calculated with the
expiresInreceived by the authorization server.
-
getScope
@Nullable public java.lang.String getScope()
- Returns:
- Scope of the access token.
-
setScope
public void setScope(@Nullable java.lang.String scope)- Parameters:
scope- Scope of the access token.
-
getRefreshToken
@Nullable public java.lang.String getRefreshToken()
- Returns:
- The refresh token, which can be used to obtain new access tokens using the same authorization grant.
-
setRefreshToken
public void setRefreshToken(@Nullable java.lang.String refreshToken)- Parameters:
refreshToken- The refresh token, which can be used to obtain new access tokens using the same authorization grant.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-