Using AWS Cognito, I want to create dummy users for testing purposes.
I then use the AWS Console to create such user, but the user has its status set to FORCE_CHANGE_PASSWORD
. With that value, this user cannot be authenticated.
Is there a way to change this status?
UPDATE Same behavior when creating user from CLI
Amazon Cognito can automatically verify email addresses or phone numbers. To do this verification, Amazon Cognito sends a verification code or a verification link. For email addresses, Amazon Cognito can send a code or a link in an email message. For phone numbers, Amazon Cognito sends a code in an SMS text message.
Changing user passwords on Linux First sign on or “su” or “sudo” to the “root” account on Linux, run: sudo -i. Then type, passwd tom to change a password for tom user. The system will prompt you to enter a password twice.
Call the SignUp API action, and provide the email address and phone number for the UserAttributes parameter. At this point, Amazon Cognito sends a verification code to the user's phone. In your app interface, present a confirmation page where the user enters the verification code.
ADMIN_USER_PASSWORD_AUTH was formerly known as ADMIN_NO_SRP_AUTH. If you have a server-side app: It calls the AdminInitiateAuth API. This requires AWS admin credentials & returns the authentication parameters. It then calls the AdminRespondToAuthChallenge API, which also requires AWS admin credentials.
This has finally been added to AWSCLI: https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/admin-set-user-password.html
You can change a user's password and update status using:
aws cognito-idp admin-set-user-password \
--user-pool-id <your-user-pool-id> \
--username <username> \
--password <password> \
--permanent
Before using this, you may need to update your AWS CLI using:
pip3 install awscli --upgrade
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With