Class 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 of action parameter from the response. The list below shows possible values of action 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 the accessToken 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 the accessToken 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
    • Constructor Detail

      • TokenUpdateResponse

        public TokenUpdateResponse()
    • Method Detail

      • getAction

        public TokenUpdateResponse.Action getAction()
        Get the code indicating how the response should be interpreted. See the description 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 the description 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 by TokenUpdateRequest.
        Returns:
        Access token.
      • setAccessToken

        public TokenUpdateResponse setAccessToken​(String accessToken)
        Set the access token which has been specified by TokenUpdateRequest.
        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
      • 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