Class TokenUpdateResponse
- java.lang.Object
-
- com.authlete.common.dto.ApiResponse
-
- com.authlete.common.dto.TokenUpdateResponse
-
- All Implemented Interfaces:
Serializable
public class TokenUpdateResponse extends ApiResponse
Response from Authlete's/auth/token/update
API.Authlete's
/auth/token/update
API returns JSON which can be mapped to this class. The first step that a caller should take is to retrieve the value ofaction
parameter from the response. The list below shows possible values ofaction
parameter and their meanings.INTERNAL_SERVER_ERROR
-
When the value of
action
parameter is"INTERNAL_SERVER_ERROR"
, it means that an error occurred on Authlete side. BAD_REQUEST
-
When the value of
action
parameter is"BAD_REQUEST"
, it means that the request from the caller was wrong. For example, this happens when theaccessToken
request parameter is not specified. FORBIDDEN
-
When the value of
action
parameter is"FORBIDDEN"
, it means that the request from the caller is not allowed. For example, this happens when the access token identified by theaccessToken
request parameter does not belong to the service identified by the API key used for the API call. NOT_FOUND
-
When the value of
action
parameter is"NOT_FOUND"
, it means that the specified access token does not exist. OK
-
When the value of
action
parameter is"OK"
, it means that the access token was updated successfully.
- Since:
- 1.34
- Author:
- Takahiko Kawasaki
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TokenUpdateResponse.Action
The code indicating how the response should be interpreted.
-
Constructor Summary
Constructors Constructor Description TokenUpdateResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAccessToken()
Get the access token which has been specified byTokenUpdateRequest
.long
getAccessTokenExpiresAt()
Get the date at which the access token will expire.TokenUpdateResponse.Action
getAction()
Get the code indicating how the response should be interpreted.AuthzDetails
getAuthorizationDetails()
Get the authorization details.Property[]
getProperties()
Get the properties associated with the access token.long
getRefreshTokenExpiresAt()
Get the date at which the refresh token will expire.String[]
getScopes()
Get the scopes associated with the access token.String
getTokenId()
Get the token identifier.String
getTokenType()
Get the token type associated with the access token.boolean
isForExternalAttachment()
Get the flag which indicates whether the access token is for an external attachment.TokenUpdateResponse
setAccessToken(String accessToken)
Set the access token which has been specified byTokenUpdateRequest
.TokenUpdateResponse
setAccessTokenExpiresAt(long expiresAt)
Set the date at which the access token will expire.TokenUpdateResponse
setAction(TokenUpdateResponse.Action action)
Set the code indicating how the response should be interpreted.TokenUpdateResponse
setAuthorizationDetails(AuthzDetails authorizationDetails)
Set the authorization details.TokenUpdateResponse
setForExternalAttachment(boolean forExternalAttachment)
Set the flag which indicates whether the access token is for an external attachment.TokenUpdateResponse
setProperties(Property[] properties)
Set the properties associated with the access token.TokenUpdateResponse
setRefreshTokenExpiresAt(long expiresAt)
Set the date at which the refresh token will expire.TokenUpdateResponse
setScopes(String[] scopes)
Set the scopes associated with the access token.TokenUpdateResponse
setTokenId(String tokenId)
Set the token identifier.TokenUpdateResponse
setTokenType(String tokenType)
Set the token type associated with the access token.String
summarize()
Get the summary of this instance.-
Methods inherited from class com.authlete.common.dto.ApiResponse
getResultCode, getResultMessage, setResultCode, setResultMessage
-
-
-
-
Method Detail
-
getAction
public TokenUpdateResponse.Action getAction()
Get the code indicating how the response should be interpreted. See thedescription
of this class for details.- Returns:
- The code indicating how the response should be interpreted.
-
setAction
public TokenUpdateResponse setAction(TokenUpdateResponse.Action action)
Set the code indicating how the response should be interpreted. See thedescription
of this class for details.- Parameters:
action
- The code indicating how the response should be interpreted.- Returns:
this
object.
-
getAccessToken
public String getAccessToken()
Get the access token which has been specified byTokenUpdateRequest
.- Returns:
- Access token.
-
setAccessToken
public TokenUpdateResponse setAccessToken(String accessToken)
Set the access token which has been specified byTokenUpdateRequest
.- Parameters:
accessToken
- Access token.- Returns:
this
object.
-
getAccessTokenExpiresAt
public long getAccessTokenExpiresAt()
Get the date at which the access token will expire.- Returns:
- The expiration date in milliseconds since the Unix epoch (1970-01-01).
-
setAccessTokenExpiresAt
public TokenUpdateResponse setAccessTokenExpiresAt(long expiresAt)
Set the date at which the access token will expire.- Parameters:
expiresAt
- The expiration date in milliseconds since the Unix epoch (1970-01-01).- Returns:
this
object.
-
getRefreshTokenExpiresAt
public long getRefreshTokenExpiresAt()
Get the date at which the refresh token will expire.- Returns:
- The expiration date in milliseconds since the Unix epoch (1970-01-01).
- Since:
- 3.84
-
setRefreshTokenExpiresAt
public TokenUpdateResponse setRefreshTokenExpiresAt(long expiresAt)
Set the date at which the refresh token will expire.- Parameters:
expiresAt
- The expiration date in milliseconds since the Unix epoch (1970-01-01).- Returns:
this
object.- Since:
- 3.84
-
getScopes
public String[] getScopes()
Get the scopes associated with the access token.- Returns:
- Scopes. May be
null
.
-
setScopes
public TokenUpdateResponse setScopes(String[] scopes)
Set the scopes associated with the access token.- Parameters:
scopes
- Scopes.- Returns:
this
object.
-
getProperties
public Property[] getProperties()
Get the properties associated with the access token.- Returns:
- Properties. May be
null
.
-
setProperties
public TokenUpdateResponse setProperties(Property[] properties)
Set the properties associated with the access token.- Parameters:
properties
- Properties.- Returns:
this
object.
-
getTokenType
public String getTokenType()
Get the token type associated with the access token.- Returns:
- Token type. (example: Bearer)
- Since:
- 2.31
-
setTokenType
public TokenUpdateResponse setTokenType(String tokenType)
Set the token type associated with the access token.- Parameters:
tokenType
- Token type. (example: Bearer)- Returns:
this
object.- Since:
- 2.31
-
summarize
public String summarize()
Get the summary of this instance.
-
getAuthorizationDetails
public AuthzDetails getAuthorizationDetails()
Get the authorization details. This represents the value of the"authorization_details"
request parameter which is defined in "OAuth 2.0 Rich Authorization Requests".- Returns:
- Authorization details.
- Since:
- 2.99
-
setAuthorizationDetails
public TokenUpdateResponse setAuthorizationDetails(AuthzDetails authorizationDetails)
Set the authorization details. This represents the value of the"authorization_details"
request parameter which is defined in "OAuth 2.0 Rich Authorization Requests".- Parameters:
authorizationDetails
- Authorization details.- Returns:
this
object.- Since:
- 2.99
-
isForExternalAttachment
public boolean isForExternalAttachment()
Get the flag which indicates whether the access token is for an external attachment.- Returns:
true
if the access token is for an external attachment.- Since:
- 3.16
- See Also:
- OpenID Connect for Identity Assurance 1.0, External Attachments
-
setForExternalAttachment
public TokenUpdateResponse setForExternalAttachment(boolean forExternalAttachment)
Set the flag which indicates whether the access token is for an external attachment.- Parameters:
forExternalAttachment
-true
to indicate that the access token is for an external attachment.- Returns:
this
object.- Since:
- 3.16
- See Also:
- OpenID Connect for Identity Assurance 1.0, External Attachments
-
getTokenId
public String getTokenId()
Get the token identifier.- Returns:
- The token identifier string.
- Since:
- 3.23, Authlete API 3.0
-
setTokenId
public TokenUpdateResponse setTokenId(String tokenId)
Set the token identifier.- Parameters:
tokenId
- The token identifier string.- Returns:
this
object.- Since:
- 3.23, Authlete API 3.0
-
-