【发布时间】:2015-08-06 04:51:52
【问题描述】:
我正在使用 AWS Javascript API 并尝试获取分配的 cognito id:
AWS.config.credentials.get(function(err) {
if (!err) {
console.log("Cognito Identity Id: " + AWS.config.credentials.identityId);
}
});
为什么会导致 400 错误并显示以下消息?
{"__type":"InvalidIdentityPoolConfigurationException","message":"Invalid identity pool configuration. Check assigned IAM roles for this pool."}
我为经过身份验证和未经过身份验证的用户配置了 IAM 角色。
{
"Version": "2012-10-17",
"Statement": [{
"Action": [
"mobileanalytics:PutEvents",
"cognito-sync:*"
],
"Effect": "Allow",
"Resource": [
"*"
]
}]
}
【问题讨论】:
标签: amazon-web-services amazon-cognito amazon-javascript-sdk