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/updateAPI.Authlete's
/auth/token/updateAPI returns JSON which can be mapped to this class. The first step that a caller should take is to retrieve the value ofactionparameter from the response. The list below shows possible values ofactionparameter and their meanings.INTERNAL_SERVER_ERROR-
When the value of
actionparameter is"INTERNAL_SERVER_ERROR", it means that an error occurred on Authlete side. BAD_REQUEST-
When the value of
actionparameter is"BAD_REQUEST", it means that the request from the caller was wrong. For example, this happens when theaccessTokenrequest parameter is not specified. FORBIDDEN-
When the value of
actionparameter is"FORBIDDEN", it means that the request from the caller is not allowed. For example, this happens when the access token identified by theaccessTokenrequest parameter does not belong to the service identified by the API key used for the API call. NOT_FOUND-
When the value of
actionparameter is"NOT_FOUND", it means that the specified access token does not exist. OK-
When the value of
actionparameter 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 classTokenUpdateResponse.ActionThe 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 StringgetAccessToken()Get the access token which has been specified byTokenUpdateRequest.longgetAccessTokenExpiresAt()Get the date at which the access token will expire.TokenUpdateResponse.ActiongetAction()Get the code indicating how the response should be interpreted.AuthzDetailsgetAuthorizationDetails()Get the authorization details.Property[]getProperties()Get the properties associated with the access token.longgetRefreshTokenExpiresAt()Get the date at which the refresh token will expire.String[]getScopes()Get the scopes associated with the access token.StringgetTokenId()Get the token identifier.StringgetTokenType()Get the token type associated with the access token.booleanisForExternalAttachment()Get the flag which indicates whether the access token is for an external attachment.TokenUpdateResponsesetAccessToken(String accessToken)Set the access token which has been specified byTokenUpdateRequest.TokenUpdateResponsesetAccessTokenExpiresAt(long expiresAt)Set the date at which the access token will expire.TokenUpdateResponsesetAction(TokenUpdateResponse.Action action)Set the code indicating how the response should be interpreted.TokenUpdateResponsesetAuthorizationDetails(AuthzDetails authorizationDetails)Set the authorization details.TokenUpdateResponsesetForExternalAttachment(boolean forExternalAttachment)Set the flag which indicates whether the access token is for an external attachment.TokenUpdateResponsesetProperties(Property[] properties)Set the properties associated with the access token.TokenUpdateResponsesetRefreshTokenExpiresAt(long expiresAt)Set the date at which the refresh token will expire.TokenUpdateResponsesetScopes(String[] scopes)Set the scopes associated with the access token.TokenUpdateResponsesetTokenId(String tokenId)Set the token identifier.TokenUpdateResponsesetTokenType(String tokenType)Set the token type associated with the access token.Stringsummarize()Get the summary of this instance.-
Methods inherited from class com.authlete.common.dto.ApiResponse
getResponseHeaders, getResultCode, getResultMessage, setResponseHeaders, setResultCode, setResultMessage
-
-
-
-
Method Detail
-
getAction
public TokenUpdateResponse.Action getAction()
Get the code indicating how the response should be interpreted. See thedescriptionof 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 thedescriptionof this class for details.- Parameters:
action- The code indicating how the response should be interpreted.- Returns:
thisobject.
-
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:
thisobject.
-
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:
thisobject.
-
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:
thisobject.- 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:
thisobject.
-
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:
thisobject.
-
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:
thisobject.- 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:
thisobject.- Since:
- 2.99
-
isForExternalAttachment
public boolean isForExternalAttachment()
Get the flag which indicates whether the access token is for an external attachment.- Returns:
trueif 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-trueto indicate that the access token is for an external attachment.- Returns:
thisobject.- 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:
thisobject.- Since:
- 3.23, Authlete API 3.0
-
-