adminUserGlobalSignOut method

Future<void> adminUserGlobalSignOut({
  1. required String userPoolId,
  2. required String username,
})

Signs out users from all devices, as an administrator. 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.

Calling this action requires developer credentials.

May throw ResourceNotFoundException. May throw InvalidParameterException. May throw TooManyRequestsException. May throw NotAuthorizedException. May throw UserNotFoundException. May throw InternalErrorException.

Parameter userPoolId : The user pool ID.

Parameter username : The user name.

Implementation

Future<void> adminUserGlobalSignOut({
  required String userPoolId,
  required String username,
}) async {
  ArgumentError.checkNotNull(userPoolId, 'userPoolId');
  _s.validateStringLength(
    'userPoolId',
    userPoolId,
    1,
    55,
    isRequired: true,
  );
  ArgumentError.checkNotNull(username, 'username');
  _s.validateStringLength(
    'username',
    username,
    1,
    128,
    isRequired: true,
  );
  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,
    },
  );
}