Add custom attribute to user created in AWS Cognito console

2.1k Views Asked by At

I have an app with AWS Cognito auth implemented using Amplify. I do not want users to be able to sign up, instead the admin will sign up users via the AWS Cognito user pool console, by creating a new user.

I have created a custom attribute for users for a AWS Cognito userpool. I want to assign a value to that attribute for a user either when creating the user or after the user is created.

I cannot see how to fill in any values for attributes for a user when creating a user in the AWS Coginto user pool console.

When opening a created user in the console, I do not see how to add values for attributes for that user.

I have probably missed something in the Docs, but can someone tell me how to add values for attributes (including custom ones) for a user created in the AWS Cognito userpool console.

1

There are 1 best solutions below

2
On BEST ANSWER

This is very simple solution. Cognito console doesn't allow to input custom attributes or required any attributes by admin. This is norm because the user's info should be filled by himself.

So This is the workflow how this invitation auth flow would work in Cognito:

  • The admin creates new user in the console by inputting username, temp password only(He can chooses whether to send a verification email or not and auto-verified phone number or email upon creating)
  • Cognito will send the invitation email to the user with verification code or link codeParameter (If you would use custom message Lambda trigger trigger for this use case, you can customize the email message and put the username and temporary password along together). At this point, you should include URL to redirect the user to your app's update password page.
  • In this update page, you should let him to input any required attributes himself and change password to complete the signup (In Cognito console, you should configure any attributes you need to get upon signup as required).

Here is the helpful link for you to review in order to understand how to complete the signup with Cognito by Amplify Lib: https://docs.amplify.aws/lib/auth/manageusers/q/platform/js#complete-new-password

Cheers