Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to edit user attributes in AWS Cognito User Pool for specific user?

I'm using AWS Cognito User Pool and have created some users. Now I would like to change some of the attributes for a specific user such as name, address, etc...

Is it possible to do this on an AWS Website? If so, how?

like image 275
MichaD Avatar asked Nov 28 '16 13:11

MichaD


People also ask

How do I update user attributes in Cognito?

To update a cognito user's attributes use the admin-update-user-attributes command, specifying the user-pool-id , username and user-attributes parameters.

How do I change attributes in user pool?

Short description. You can't change standard user pool attributes after a user pool is created. Instead, create a new user pool with the attributes that you want to require for user registration. Then, migrate existing users to the new user pool by using an AWS Lambda function as a user migration trigger.

How do you want to map identity provider attributes to user pool attributes?

In the navigation pane, choose User Pools, and choose the user pool you want to edit. Choose the Sign-in experience tab and locate Federated sign-in. Choose Add an identity provider, or choose the Facebook, Google, Amazon or Apple IdP you have configured. Locate Attribute mapping and choose Edit.

Can I change username in Cognito?

The user name is a fixed value that users can't change. If you mark an attribute as an alias, users can sign in with that attribute in place of the user name. You can mark the email address, phone number, and preferred username attributes as aliases.


2 Answers

The console does not have that capability but it can be done in the AWS Command Line Interface.

aws cognito-idp admin-update-user-attributes \     --user-pool-id xxx \     --username yyy \     --user-attributes Name=xxx,Value=yyy Name=ttt,Value=sss ... 

Custom attributes use the following syntax:

--user-attributes Name="custom:attributeName",Value="value with space" 

You need to set up your credentials with cli first (only the first time), via the command:

aws configure 

but after that it is straightforward. For more:

aws cognito-idp admin-update-user-attributes help 
like image 167
Bruce0 Avatar answered Oct 22 '22 12:10

Bruce0


The new Cognito console interface is able to edit now.

From console go to Amazon Cognito > User pools > {the user pool you want to select} > {user you want to edit}

Under "User attributes" card, click "Edit" on the right enter image description here

like image 25
unacorn Avatar answered Oct 22 '22 10:10

unacorn