By using AWS re:Post, you agree to the Terms of Use

AdminGetUser method does not return all fields in the list of UserAttrubutes

0

Hello I'm trying to get user information by userid but it does not return all list of UserAttributes

Trying to get using this method

 const user = await this.cognito
      .adminGetUser({
        ...this.defaultParams,
        Username: userId,
      })
      .promise();

Actual Response

{
  "Username": "XXXXXXXXXXXXXXXXXXXX",
  "UserAttributes": [
    { "Name": "sub", "Value": "Any" },
    { "Name": "email_verified", "Value": "true" },
    { "Name": "email", "Value": "abc@gmail.com" }
  ]
}

Expected Response

{
  "Username": "XXXXXXXXXXXXXXXXXXXX",
  "UserAttributes": [
    { "Name": "sub", "Value": "Any" },
    { "Name": "email_verified", "Value": "true" },
    { "Name": "email", "Value": "abc@gmail.com" },  
    { "Name": "name", "Value": "first name" } ,
    { "Name": "family_name", "Value": "last name" }
  ]
}

Could someone please let me know why AdminGetUser does not return name and family_name in the list of UserAttributes?

  • Hey bro can you share code snippet please I'm in trouble Please help please.