Skip to content

Instantly share code, notes, and snippets.

@pilgrim2go
Forked from miguelmota/auth.json
Created May 5, 2020 04:43
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 pilgrim2go/1b02c76f881ae0be32ea995420172867 to your computer and use it in GitHub Desktop.
Save pilgrim2go/1b02c76f881ae0be32ea995420172867 to your computer and use it in GitHub Desktop.
AWS Cognito Identity authenticate using cURL
{
"AuthParameters" : {
"USERNAME" : "alice@example.com",
"PASSWORD" : "mysecret"
},
"AuthFlow" : "USER_PASSWORD_AUTH",
"ClientId" : "9..............."
}
curl -X POST --data @auth.json \
-H 'X-Amz-Target: AWSCognitoIdentityProviderService.InitiateAuth' \
-H 'Content-Type: application/x-amz-json-1.1' \
https://cognito-idp.us-east-1.amazonaws.com/
Dashboard -> "App Clients" -> "Show Details" -> check "Enable username-password (non-SRP) flow for app-based authentication (USER_PASSWORD_AUTH)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment