revokeOAuth2TokenWithIAM method
Grants permission to revoke an OAuth 2.0 refresh token and its associated refresh tokens Revokes a refresh_token issued by AWS Sign-In, invalidating the entire token chain so that the refresh_token can no longer be used to mint new access_tokens. Idempotency: revoking an already-revoked, expired, or otherwise invalid token still returns 200 OK with an empty body. Only the refresh_token type is accepted.
May throw AccessDeniedException.
May throw InternalServerException.
May throw TooManyRequestsError.
May throw ValidationException.
Parameter token :
The refresh_token to revoke. Must be a refresh_token issued by AWS Sign-In
(prefix "ASOR"); access_tokens are not accepted for revocation.
Implementation
Future<void> revokeOAuth2TokenWithIAM({
required String token,
}) async {
final $payload = <String, dynamic>{
'token': token,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/v1/revoke?x-amz-client-auth-method=iam',
endpoint: _resolveEndpoint(
isoAuthEndpoint: true,
),
exceptionFnMap: _exceptionFns,
);
}