gpt4 book ai didi

amazon-web-services - AWS Cognito 无法在 CognitoIdentityCredentials 上设置凭证

转载 作者:行者123 更新时间:2023-12-04 15:40:21 27 4
gpt4 key购买 nike

我在为 AWS Cognito 设置凭证时遇到问题。

我有以下来自 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()
}
});

我已经检查过我发送的是正确的 IdentityPoolIdLoginsCognitoIdentityCredentials方法,但我在 accessKeyId 和 sessionToken 上未定义作为返回。

下面是我得到的。 CognitoIdentityCredentials {expired: true, expireTime: null, accessKeyId: undefined, sessionToken: undefined, params: Object…}
知道如何解决这个问题吗?

最佳答案

在此之后,您是否调用“AWS.config.credentials.get()”以确保凭证提供者请求凭证?

关于amazon-web-services - AWS Cognito 无法在 CognitoIdentityCredentials 上设置凭证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43175901/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com