3
我遇到了爲AWS Cognito設置憑據的問題。AWS Cognito無法在CognitoIdentityCredentials上設置憑據
我有以下從AWS amazon-cognito-identity-js代碼用例4.
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…}
任何想法如何解決這個問題?