javascript - 无法通过 Nodejs 中的用户池返回的令牌访问身份池
问题描述
用户登录成功后,我正在尝试使用用户池返回的令牌访问身份池,但现在我得到:These credentials are not valid for accessing this resource
。我已经在身份池的身份验证提供者中设置了 UserpoolId 和 ClientId。这是我的代码
AWS.config.region = 'us-xxx-xx';
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId: 'us-xxxxxx',
Logins: {
'cognito-idp.us-xxx-xx.amazonaws.com/us-xxx-xxx': 'token-return-from-user-pool'
},
});
const cognito = new CognitoIdentity;
const openIdToken = await cognito.getOpenIdTokenForDeveloperIdentity({
IdentityPoolId: 'us-xxxxxx',
Logins: {
'cognito-idp.us-xxx-xx.amazonaws.com/us-xxx-xxx': 'token-return-from-user-pool'
},
TokenDuration: 3600,
}).promise();
我收到此错误:These credentials are not valid for accessing this resource
我哪里错了?请帮我
解决方案
推荐阅读
- database - 为什么 dolphindb 脚本中的函数无法访问外部范围内的变量
- git - Git子模块git@github.com:权限被拒绝(公钥)错误
- solr - Solr Cloud Kerberos cookie 拒绝 spnego
- java - 当我尝试解析 JSON 字符串时收到意外的内部错误
- python - Differente Betweent Dates - Integer results
- python - 使用 gTTS 说话而不是保存为 mp3?
- flutter - 颤振错误:'indexOf(child)> index':不正确。(StreamBuilder,PageView)
- flutter - 颤振错误:垂直视口的高度没有限制
- spring-kafka - Spring Kafka 2.2.2 Consumer 只返回一条记录而不是 max-poll-records
- c# - 创建和使用协变和可变列表(或潜在的解决方法)