adminUserGlobalSignOut method
Invalidates the identity, access, and refresh tokens that Amazon Cognito issued to a user. Call this operation with your administrative credentials when your user signs out of your app. This results in the following behavior.
-
Amazon Cognito no longer accepts token-authorized user operations
that you authorize with a signed-out user's access tokens. For more
information, see Using
the Amazon Cognito user pools API and user pool endpoints.
Amazon Cognito returns an
Access Token has been revokederror when your app attempts to authorize a user pools API request with a revoked access token that contains the scopeaws.cognito.signin.user.admin. -
Amazon Cognito no longer accepts a signed-out user's ID token in a GetId
request to an identity pool with
ServerSideTokenCheckenabled for its user pool IdP configuration in CognitoIdentityProvider. - Amazon Cognito no longer accepts a signed-out user's refresh tokens in refresh requests.
May throw InternalErrorException.
May throw InvalidParameterException.
May throw NotAuthorizedException.
May throw OperationNotEnabledException.
May throw ResourceNotFoundException.
May throw TooManyRequestsException.
May throw UserNotFoundException.
Parameter userPoolId :
The ID of the user pool where you want to sign out a user.
Parameter username :
The name of the user that you want to query or modify. The value of this
parameter is typically your user's username, but it can be any of their
alias attributes. If username isn't an alias attribute in
your user pool, this value must be the sub of a local user or
the username of a user from a third-party IdP.
Implementation
Future<void> adminUserGlobalSignOut({
required String userPoolId,
required String username,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSCognitoIdentityProviderService.AdminUserGlobalSignOut'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'UserPoolId': userPoolId,
'Username': username,
},
);
}