What is the REST (or CLI) API for logging in to Amazon Cognito user pools

后端 未结 7 1898
离开以前
离开以前 2020-12-05 02:46

How do i make logins happen via Amazon Cognito REST APIs (for user pools) on platforms for which there is no official SDK? - Note that i am asking

7条回答
  •  臣服心动
    2020-12-05 03:28

    Sharing curl direct may help to anyone

    curl -X POST --data @user-data.json \
    -H 'X-Amz-Target: AWSCognitoIdentityProviderService.InitiateAuth' \
    -H 'Content-Type: application/x-amz-json-1.1' \
    https://cognito-idp..amazonaws.com/
    

    file json user-data.json

    {"AuthParameters" : {"USERNAME" : "sadfsf", "PASSWORD" : "password"}, "AuthFlow" : "USER_PASSWORD_AUTH", "ClientId" : "csdfhripnv7sq027kktf75"}
    

    make sure your app client does not contain app-secret or create new app without secret. also inside app enable USER_PASSWORD_AUTH

提交回复
热议问题