aws-cli
CognitoUserPools

Cognito User Poolsでユーザーを取得する

$ aws cognito-idp admin-get-user --user-pool-id COGNITO_USER_POOLS_ID --username USERNAMEでいけます。

User does not existが返ってきたらユーザーは存在しない(or退会済)です。

$ aws cognito-idp admin-get-user --user-pool-id COGNITO_USER_POOLS_ID --username USERNAME

An error occurred (UserNotFoundException) when calling the AdminGetUser operation: User does not exist.

成功したらこんな感じ。

$ aws cognito-idp admin-get-user --user-pool-id COGNITO_USER_POOLS_ID --username hideokamoto

{
"Username": "hideokamoto",
"MFAOptions": [
{
"DeliveryMedium": "SMS",
"AttributeName": "phone_number"
}
],
"Enabled": true,
"UserStatus": "CONFIRMED",
"PreferredMfaSetting": "SMS_MFA",
"UserCreateDate": 1484806199.008,
"UserAttributes": [
{
"Name": "sub",
"Value": "b3e56722-c100-4fec-9d0d-a1311481a0f0"
},