CognitoIdentityProvider / Client / admin_revoke_user_session
admin_revoke_user_session¶
- CognitoIdentityProvider.Client.admin_revoke_user_session(**kwargs)¶
Revokes a specific user session as an administrator. Amazon Cognito revokes all refresh and access tokens that are associated with the session and deletes the session record. You can revoke either a token session or an SSO session, and you can optionally cascade the revocation to linked sessions.
See also: AWS API Documentation
Request Syntax
response = client.admin_revoke_user_session( UserPoolId='string', Username='string', SessionId='string', RevokeAssociatedSessions='NONE'|'LINKED' )
- Parameters:
UserPoolId (string) –
[REQUIRED]
The ID of the user pool that contains the session.
Username (string) –
[REQUIRED]
The username of the user who owns the session. The username must match the user associated with the
SessionId, to confirm they are the intended target user.SessionId (string) –
[REQUIRED]
The ID of the session to revoke. This is a 28-character string of lowercase letters and digits, prefixed with
tknfor a token session orssofor an SSO session.RevokeAssociatedSessions (string) – Specifies whether to also revoke the sessions that are linked to the targeted session.
NONE, the default, revokes only the targeted session.LINKEDalso revokes the directly linked session or sessions, interpreted relative to the type of the targeted session: revoking a token session also revokes the parent SSO session it came through, and revoking an SSO session also revokes the token sessions that came through it. The set of linked sessions is eventually consistent, so associated sessions are typically revoked within a few seconds.
- Return type:
dict
- Returns:
Response Syntax
{}Response Structure
(dict) –
Exceptions
CognitoIdentityProvider.Client.exceptions.InvalidParameterExceptionCognitoIdentityProvider.Client.exceptions.ResourceNotFoundExceptionCognitoIdentityProvider.Client.exceptions.TooManyRequestsExceptionCognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptionCognitoIdentityProvider.Client.exceptions.UserNotFoundExceptionCognitoIdentityProvider.Client.exceptions.OperationNotEnabledExceptionCognitoIdentityProvider.Client.exceptions.InternalErrorException