是否可以在不使用SDK的情况下通过REST API登录到Amazon Cognito [英] Is it possible to login to Amazon Cognito via REST API without using the SDK

查看:175
本文介绍了是否可以在不使用SDK的情况下通过REST API登录到Amazon Cognito的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在这里查看AWS Cognito文档使用用户池进行身份验证

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.

在AWS Cognito中,我使用提供的平台SDK(放大)在Android和iOS中成功创建了用户池,应用程序客户端以及集成的注册和登录.但我想直接从REST客户端执行此操作,以进行测试以生成用户令牌.我要提交所需的凭据,用户名和密码,并像从SDK中一样获取用户令牌.

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"
}

这有可能吗?如何?

推荐答案

我刚刚设法完成了它.在Cognito控制台中创建应用程序客户端时,有一个设置 Enable Client Secret

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

要使该功能正常工作,您需要在禁用 Enable Client Secret 的情况下创建另一个App客户端.然后使用在此答案中 提及的示例

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

这篇关于是否可以在不使用SDK的情况下通过REST API登录到Amazon Cognito的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆