Guest User

Untitled

a guest
Jul 3rd, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Fill in correct variables
  4. export PROFILE=<<AWS PROFILE>>
  5. export POOLID=<<COGNITO POOL ID>>
  6. export CLIENTID=<<COGNITO CLIENT ID>>
  7. export COGUSER=<<COGNITO USER ID>>
  8. export COGPASS=<<COGNITO USER PASSWORD>>
  9.  
  10. # AWS commands and parsing the JSON response
  11. 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`
  12. export SESSIONKEY=`jq -ar .Session <<< $SESSIONKEY`
  13. 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