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 tkn for a token session or sso for 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. LINKED also 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