Note: You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . cognito-idp ]

admin-get-user

Description

Gets the specified user by user name in a user pool as an administrator. Works on any user.

Calling this action requires developer credentials.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  admin-get-user
--user-pool-id <value>
--username <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--user-pool-id (string)

The user pool ID for the user pool where you want to get information about the user.

--username (string)

The user name of the user you want to retrieve.

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Examples

Note

To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.

Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal's quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .

To get a user

This example gets information about username jane@example.com.

Command:

aws cognito-idp admin-get-user --user-pool-id us-west-2_aaaaaaaaa --username jane@example.com

Output:

{
  "Username": "4320de44-2322-4620-999b-5e2e1c8df013",
  "Enabled": true,
  "UserStatus": "FORCE_CHANGE_PASSWORD",
  "UserCreateDate": 1548108509.537,
  "UserAttributes": [
      {
          "Name": "sub",
          "Value": "4320de44-2322-4620-999b-5e2e1c8df013"
      },
      {
          "Name": "email_verified",
          "Value": "true"
      },
      {
          "Name": "phone_number_verified",
          "Value": "true"
      },
      {
          "Name": "phone_number",
          "Value": "+01115551212"
      },
      {
          "Name": "email",
          "Value": "jane@example.com"
      }
  ],
  "UserLastModifiedDate": 1548108509.537
}

Output

Username -> (string)

The user name of the user about whom you're receiving information.

UserAttributes -> (list)

An array of name-value pairs representing user attributes.

(structure)

Specifies whether the attribute is standard or custom.

Name -> (string)

The name of the attribute.

Value -> (string)

The value of the attribute.

UserCreateDate -> (timestamp)

The date the user was created.

UserLastModifiedDate -> (timestamp)

The date the user was last modified.

Enabled -> (boolean)

Indicates that the status is enabled .

UserStatus -> (string)

The user status. Can be one of the following:

  • UNCONFIRMED - User has been created but not confirmed.
  • CONFIRMED - User has been confirmed.
  • ARCHIVED - User is no longer active.
  • UNKNOWN - User status isn't known.
  • RESET_REQUIRED - User is confirmed, but the user must request a code and reset their password before they can sign in.
  • FORCE_CHANGE_PASSWORD - The user is confirmed and the user can sign in using a temporary password, but on first sign-in, the user must change their password to a new value before doing anything else.

MFAOptions -> (list)

This response parameter is no longer supported. It provides information only about SMS MFA configurations. It doesn't provide information about time-based one-time password (TOTP) software token MFA configurations. To look up information about either type of MFA configuration, use UserMFASettingList instead.

(structure)

This data type is no longer supported. Applies only to SMS multi-factor authentication (MFA) configurations. Does not apply to time-based one-time password (TOTP) software token MFA configurations.

DeliveryMedium -> (string)

The delivery medium to send the MFA code. You can use this parameter to set only the SMS delivery medium value.

AttributeName -> (string)

The attribute name of the MFA option type. The only valid value is phone_number .

PreferredMfaSetting -> (string)

The user's preferred MFA setting.

UserMFASettingList -> (list)

The MFA options that are activated for the user. The possible values in this list are SMS_MFA and SOFTWARE_TOKEN_MFA .

(string)