Skip to content

Instantly share code, notes, and snippets.

@iampeterbanjo
Created May 30, 2018 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iampeterbanjo/e51d759710690a0be52ad9854c002160 to your computer and use it in GitHub Desktop.
Save iampeterbanjo/e51d759710690a0be52ad9854c002160 to your computer and use it in GitHub Desktop.
AWS change user password using CLI
# https://stackoverflow.com/a/45253010/95055
# Step 1: Get a session token for the desired user:
aws cognito-idp admin-initiate-auth --user-pool-id %USER POOL ID% --client-id %APP CLIENT ID% --auth-flow ADMIN_NO_SRP_AUTH --auth-parameters USERNAME=%USERS USERNAME%,PASSWORD=%USERS CURRENT PASSWORD%
# Step 2: Issue the challenge response:
aws cognito-idp admin-respond-to-auth-challenge --user-pool-id %USER POOL ID% --client-id %CLIENT ID% --challenge-name NEW_PASSWORD_REQUIRED --challenge-responses NEW_PASSWORD=%DESIRED PASSWORD%,USERNAME=%USERS USERNAME% --session %SESSION KEY FROM PREVIOUS COMMAND with ""%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment