CognitoIdentityProvider / Client / revoke_token

revoke_token#

CognitoIdentityProvider.Client.revoke_token(**kwargs)#

Revokes all of the access tokens generated by, and at the same time as, the specified refresh token. After a token is revoked, you can’t use the revoked token to access Amazon Cognito user APIs, or to authorize access to your resource server.

See also: AWS API Documentation

Request Syntax

response = client.revoke_token(
    Token='string',
    ClientId='string',
    ClientSecret='string'
)
Parameters:
  • Token (string) –

    [REQUIRED]

    The refresh token that you want to revoke.

  • ClientId (string) –

    [REQUIRED]

    The client ID for the token that you want to revoke.

  • ClientSecret (string) – The secret for the client ID. This is required only if the client ID has a secret.

Return type:

dict

Returns:

Response Syntax

{}

Response Structure

  • (dict) –

Exceptions

  • CognitoIdentityProvider.Client.exceptions.TooManyRequestsException

  • CognitoIdentityProvider.Client.exceptions.InternalErrorException

  • CognitoIdentityProvider.Client.exceptions.UnauthorizedException

  • CognitoIdentityProvider.Client.exceptions.InvalidParameterException

  • CognitoIdentityProvider.Client.exceptions.UnsupportedOperationException

  • CognitoIdentityProvider.Client.exceptions.UnsupportedTokenTypeException

  • CognitoIdentityProvider.Client.exceptions.ForbiddenException