AWS Cognito user pool identity REST examples

非 Y 不嫁゛ 提交于 2020-01-01 03:13:12

问题


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.


回答1:


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

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.




回答2:


Maybe you are looking for this?

Actions supported by Amazon Cognito REST APIs



来源:https://stackoverflow.com/questions/37803320/aws-cognito-user-pool-identity-rest-examples

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