AWS Cognito用户池身份REST示例 [英] AWS Cognito user pool identity REST examples

查看:84
本文介绍了AWS Cognito用户池身份REST示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在考虑将用户池用于我们的应用程序。我想以REST方式尝试API。 https://docs.aws.amazon.com/cognito- user-identity-pools / latest / APIReference / Welcome.html 没有其他请求和响应示例。寻找SignUp,ResendConfirmationCode,ChangePassword和ConfirmSignUp示例。

We are looking into using user pools for our application. I would like to try out API in REST manner. Documentation at https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/Welcome.html doesn't have request and response examples like others. Looking for SignUp, ResendConfirmationCode,ChangePassword and ConfirmSignUp examples.

推荐答案

当前不在Cognito用户池文档中,但是以下示例适用于SignUp。同样,您可以为其他API制定公式。有效载荷应该是您所指出的文档中提到的

Currently it is not in Cognito user pools documentation, but following example should work for SignUp. Similarly you can formulate it for other APIs. Payload should be what has been mentioned in the documentation you pointed

CONTENT-TYPE: application/x-amz-json-1.1
X-AMZ-TARGET: com.amazonaws.cognito.identity.idp.model.AWSCognitoIdentityProviderService.SignUp

HOST: https://cognito-idp.us-east-1.amazonaws.com

{
"ClientId": "string",
"Password": "string",
"SecretHash": "string",
"UserAttributes": [
    {
        "Name": "string",
        "Value": "string"
    }
],
"Username": "string",
"ValidationData": [
    {
        "Name": "string",
        "Value": "string"
    }
]
}

由于身份验证期间客户端的复杂SRP计算逻辑,建议使用随Cognito用户池一起提供的SDK。但是似乎您上面提到的API不应该进行此计算,因此应该可以进行REST调用。

Due to complex SRP calculation logic on client side during authentication, it is recommended to use the SDKs provided along with Cognito user pools. But seems like the APIs you mentioned above should not have this calculation, so it should be possible to make REST calls.

这篇关于AWS Cognito用户池身份REST示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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