globalSignOut method

Future<void> globalSignOut({
  1. required String accessToken,
})

Signs out users from all devices. It also invalidates all refresh tokens issued to a user. The user's current access and Id tokens remain valid until their expiry. Access and Id tokens expire one hour after they are issued.

May throw ResourceNotFoundException. May throw InvalidParameterException. May throw NotAuthorizedException. May throw TooManyRequestsException. May throw PasswordResetRequiredException. May throw UserNotConfirmedException. May throw InternalErrorException.

Parameter accessToken : The access token.

Implementation

Future<void> globalSignOut({
  required String accessToken,
}) async {
  ArgumentError.checkNotNull(accessToken, 'accessToken');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSCognitoIdentityProviderService.GlobalSignOut'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AccessToken': accessToken,
    },
  );
}