How to change password of AWS Cognito User?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
AWS Cognito is a robust user identity management service that allows you to add user sign-up, sign-in, and access control to web and mobile applications. One of the essential features of any user-authentication system is the ability to change the password securely. This article will guide you through changing a user's password in AWS Cognito using both the AWS Management Console and AWS SDK.
Prerequisites
Before proceeding, ensure you have the following:
- Access to an AWS account.
- Cognito User Pool set up with at least one user.
- AWS CLI or AWS SDK installed if you prefer using the command line or programmatic methods.
Changing Passwords via AWS Management Console
To change a user's password via the AWS Console, follow these steps:
- Sign in to the AWS Management Console:
- Navigate to the AWS Cognito Console.
- Access your User Pool:
- Select “Manage User Pools.”
- Click on your desired user pool from the list.
- Select the User:
- Go to the "Users and groups" tab.
- Find and click on the user whose password you want to change.
- Reset the Password:
- In the user details, click on the "Reset password" button.
- You will be prompted to send an email with a temporary password to the user.
Note: This method requires the user to update their password using the temporary password received in their email.
Changing Passwords Programmatically
If you prefer an automated approach or need to change passwords programmatically, you can use AWS SDKs. Here's an example using AWS SDK for Python (Boto3):
Using Boto3 for Administrative Reset
- Password Policies: Ensure your user pool has a robust password policy set. This policy enforces strength requirements for new passwords.
- Security: Employ MFA (Multi-Factor Authentication) where possible to enhance security.
- Auditing and Logging: Use Amazon CloudWatch logs to monitor password changes and access patterns.

