【发布时间】:2017-08-27 19:18:23
【问题描述】:
我在为 AWS Cognito 设置凭证时遇到问题。
我在用例 4 上有来自 AWS amazon-cognito-identity-js 的以下代码。
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId : '...', // your identity pool id here
Logins : {
// Change the key below according to the specific region your user pool is in.
'cognito-idp.<region>.amazonaws.com/<YOUR_USER_POOL_ID>' : result.getIdToken().getJwtToken()
}
});
我检查了我在 CognitoIdentityCredentials 方法上发送的 IdentityPoolId 和 Logins 是否正确,但我在 accessKeyId 和 sessionToken 上得到未定义作为返回。
以下是我得到的。
CognitoIdentityCredentials {expired: true, expireTime: null, accessKeyId: undefined, sessionToken: undefined, params: Object…}
知道如何解决这个问题吗?
【问题讨论】:
-
您解决了这个问题吗?我也有同样的问题。
标签: amazon-web-services aws-sdk aws-cognito