Skip to content

Instantly share code, notes, and snippets.

@cbschuld
Created September 15, 2020 15:39
Show Gist options
  • Save cbschuld/21ae4c6a9341098546df2802dcf97f03 to your computer and use it in GitHub Desktop.
Save cbschuld/21ae4c6a9341098546df2802dcf97f03 to your computer and use it in GitHub Desktop.
Cognito: Reset User Password (admin) via command line

Reset a user's password on cognito via command line (admin)

This example uses named profiles for authentication and uses the aws command line (aws cli)

example:

read "?Region: " REGION && \
read "?Profile Name: " PROFILE && \
read "?Pool ID: " POOL && \
read "?Username: " USERNAME && \
read -s "?Password: " PASSWORD && \
aws cognito-idp admin-set-user-password --user-pool-id $POOL --username $USERNAME --password $PASSWORD --permanent --profile=$PROFILE --region=$REGION

more info: https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/admin-set-user-password.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment