我正在使用AdminGetUser端点获取用户详细信息,但出现错误。
{"code":"BadRequest","message":"The server did not understand the operation that was requested.","type":"client"}
在这里,我不想将SDK集成到移动应用中。因此,我将API集成到NodeJ中。
url:[https://cognito-idp.us-east-2.amazonaws.com/AdminGetUser]
Headers:
Content-Type:application/x-amz-json-1.1
Accept:/
Action:admin-get-user
Version:2016-04-18
X-Amz-Algorithm:AWS4-HMAC-SHA256
X-AMZ-TARGET:com.amazonaws.cognito.identity.idp.model.AWSCognitoIdentityProviderService.AdminGetUser
Authorization:AWS4-HMAC-SHA256 Credential=<access_key>/20181013/us-east-1/cognito-idp/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-security-token;x-amz-target;x-amz-user-agent, Signature=<Signature>
x-amz-date:20181013T102730Z
您能验证上面的代码吗?
答案 0 :(得分:0)
我认为您正在调用的是称为“ AdminGetUser”的SDK方法。
您应该调用的是此处列出的任何API:https://docs.amazonaws.cn/en_us/cognito/latest/developerguide/cognito-userpools-server-contract-reference.html
可能是 / oauth2 / userInfo 。