revoke_token
async
¶
revoke_token(
token: TokenModelType,
client_id: ClientIdType,
*,
config_overrides: Optional[AsyncCognitoIdentityProviderClientConfig] = None,
client_secret: Optional[ClientSecretType] = None,
revoke_associated_sessions: Optional[RevokeAssociatedSessionsType] = None,
) -> RevokeTokenResponse
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.
Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.
Parameters:
-
token(TokenModelType) –The refresh token that you want to revoke.
-
client_id(ClientIdType) –The ID of the app client where the token that you want to revoke was issued.
-
client_secret(Optional[ClientSecretType], default:None) –The client secret of the requested app client, if the client has a secret.
-
revoke_associated_sessions(Optional[RevokeAssociatedSessionsType], default:None) –Specifies whether to also revoke the SSO session that is linked to the token session being revoked.
NONE, the default, revokes only the token session that is associated with the refresh token.LINKEDalso revokes the parent SSO session that the token session came through; the other token sessions that came through that SSO session aren't revoked.LINKEDhas no effect when session tracking is disabled or when the token session has no parent SSO session.
Raises:
-
ForbiddenException–This exception is thrown when WAF doesn't allow your request based on a web ACL that's associated with your user pool.
-
InternalErrorException–This exception is thrown when Amazon Cognito encounters an internal error.
-
InvalidParameterException–This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
-
OperationNotEnabledException–This exception is thrown when an operation is not available in the current region or for the current user pool configuration. This can occur when attempting to perform operations that are not supported in secondary replica regions.
-
TooManyRequestsException–This exception is thrown when the user has made too many requests for a given operation.
-
UnauthorizedException–Exception that is thrown when the request isn't authorized. This can happen due to an invalid access token in the request.
-
UnsupportedOperationException–Exception that is thrown when you attempt to perform an operation that isn't enabled for the user pool client.
-
UnsupportedTokenTypeException–Exception that is thrown when an unsupported token is passed to an operation.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cognito_identity_provider/_services/async_cognito_identity_provider.py
9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 | |