Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Fill in correct variables
- export PROFILE=<<AWS PROFILE>>
- export POOLID=<<COGNITO POOL ID>>
- export CLIENTID=<<COGNITO CLIENT ID>>
- export COGUSER=<<COGNITO USER ID>>
- export COGPASS=<<COGNITO USER PASSWORD>>
- # AWS commands and parsing the JSON response
- export SESSIONKEY=`aws cognito-idp admin-initiate-auth --profile=$PROFILE --user-pool-id $POOLID --client-id $CLIENTID --auth-flow ADMIN_NO_SRP_AUTH --auth-parameters USERNAME=$COGUSER,PASSWORD=$COGPASS`
- export SESSIONKEY=`jq -ar .Session <<< $SESSIONKEY`
- aws cognito-idp admin-respond-to-auth-challenge --user-pool-id $POOLID --client-id $CLIENTID --challenge-name NEW_PASSWORD_REQUIRED --challenge-responses NEW_PASSWORD=$COGPASS,USERNAME=$COGUSER --session $SESSIONKEY
Add Comment
Please, Sign In to add comment