adminGetUser method

Future<AdminGetUserResponse> adminGetUser({
  1. required String userPoolId,
  2. required String username,
})

Given a username, returns details about a user profile in a user pool. You can specify alias attributes in the Username request parameter.

This operation contributes to your monthly active user (MAU) count for the purpose of billing.

Learn more

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 get information about the 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<AdminGetUserResponse> adminGetUser({
  required String userPoolId,
  required String username,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSCognitoIdentityProviderService.AdminGetUser'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'UserPoolId': userPoolId,
      'Username': username,
    },
  );

  return AdminGetUserResponse.fromJson(jsonResponse.body);
}