Class TokenRevokeRequest

  • All Implemented Interfaces:
    Serializable

    public class TokenRevokeRequest
    extends Object
    implements Serializable
    Request to Authlete's /auth/token/revoke API.

    The /auth/token/revoke API revokes access/refresh tokens. The API processes the request in the order shown below.

    1. When the accessTokenIdentifier request parameter is given, the access token identified by the identifier (and the corresponding refresh token) is revoked. Other request parameters are ignored and the revocation process ends here.


    2. When the refreshTokenIdentifier request parameter is given, the refresh token identified by the identifier (and the corresponding access token) is revoked. Other request parameters are ignored and the revocation process ends here.


    3. When both the clientIdentifier request parameter and the subject request parameter are given, access/refresh tokens whose client and subject match the specified values are revoked. Other request parameters are ignored and the revocation process ends here.


    4. When the clientIdentifier request parameter is given and the subject request parameter is not given, access/refresh tokens whose client matches the specified value are revoked. Other request parameters are ignored and the revocation process ends here.


    5. When the subject request parameter is given and the clientIdentifier request parameter is not given, access/refresh tokens whose subject matches the specified value are revoked. Other request parameters are ignored and the revocation process ends here.


    6. In other cases, that is, when none of the request parameters are given, the API returns 400 Bad Request.

    Since:
    3.26, Authlete 2.2.29
    See Also:
    Serialized Form
    • Constructor Detail

      • TokenRevokeRequest

        public TokenRevokeRequest()
    • Method Detail

      • getAccessTokenIdentifier

        public String getAccessTokenIdentifier()
        Get the identifier of an access token to revoke.

        The hash of an access token is recognized as an identifier as well as the access token itself.

        Returns:
        The identifier of an access token to revoke.
      • setAccessTokenIdentifier

        public TokenRevokeRequest setAccessTokenIdentifier​(String identifier)
        Set the identifier of an access token to revoke.

        The hash of an access token is recognized as an identifier as well as the access token itself.

        Parameters:
        identifier - The identifier of an access token to revoke.
        Returns:
        this instance.
      • getRefreshTokenIdentifier

        public String getRefreshTokenIdentifier()
        Get the identifier of a refresh token to revoke.

        The hash of a refresh token is recognized as an identifier as well as the refresh token itself.

        Returns:
        The identifier of a refresh token to revoke.
      • setRefreshTokenIdentifier

        public TokenRevokeRequest setRefreshTokenIdentifier​(String identifier)
        Set the identifier of a refresh token to revoke.

        The hash of a refresh token is recognized as an identifier as well as the refresh token itself.

        Parameters:
        identifier - The identifier of a refresh token to revoke.
        Returns:
        this instance.
      • getClientIdentifier

        public String getClientIdentifier()
        Get the identifier of a client.

        Both the numeric client ID and the alias are recognized as an identifier of a client.

        Returns:
        The identifier of a client.
      • setClientIdentifier

        public TokenRevokeRequest setClientIdentifier​(String identifier)
        Set the identifier of a client.

        Both the numeric client ID and the alias are recognized as an identifier of a client.

        Parameters:
        identifier - The identifier of a client.
        Returns:
        this instance.
      • getSubject

        public String getSubject()
        Get the subject of a resource owner.
        Returns:
        The subject of a resource owner.
      • setSubject

        public TokenRevokeRequest setSubject​(String subject)
        Set the subject of a resource owner.
        Parameters:
        subject - The subject of a resource owner.
        Returns:
        this object.