Is it possible to login to Amazon Cognito via REST API without using the SDK

前提是你 提交于 2021-02-11 14:53:32

问题


I'm looking at AWS Cognito documentaion here Authentication with a User Pool

Actually I looked at many links in the documentation without finding clear information about this.

In AWS Cognito, I successfully created user pool, app client and integrated signup and login in Android and iOS using the platform provided SDK (amplify). But I want to do that directly from REST client, for testing purposes to generate user tokens. I want to submit the required credentials, username and password and get the user token as I do from the SDK.

I also tried the answer here but it gives an error

{
    "__type": "NotAuthorizedException",
    "message": "Unable to verify secret hash for client 1034me0p4rkfm17oidu7mkunu5"
}

Is this is something possible and how?


回答1:


I just managed to get it done. There is a setting while you create an application client in Cognito console Enable Client Secret

To get that functionality to work, You need to create another App client with Enable Client Secret disabled. Then use the example mentioned in this answer



来源:https://stackoverflow.com/questions/60869329/is-it-possible-to-login-to-amazon-cognito-via-rest-api-without-using-the-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!