AWS Cognito无效身份池配置 [英] AWS Cognito Invalid identity pool configuration

查看:110
本文介绍了AWS Cognito无效身份池配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用AWS Javascript API并尝试获取分配的认知ID:

I am using the AWS Javascript API and trying to get the assigned cognito id:

AWS.config.credentials.get(function(err) {
    if (!err) {
        console.log("Cognito Identity Id: " + AWS.config.credentials.identityId);
    }
});

为什么以下消息会导致400错误?

Why does this result in a 400 error with the message below?

{"__type":"InvalidIdentityPoolConfigurationException","message":"Invalid identity pool configuration. Check assigned IAM roles for this pool."}

我为经过身份验证和未经过身份验证的用户配置了IAM角色。

I have IAM roles configured for authenticated and non-authenticated users.

{
"Version": "2012-10-17",
"Statement": [{
    "Action": [
        "mobileanalytics:PutEvents",
        "cognito-sync:*"
    ],
    "Effect": "Allow",
    "Resource": [
        "*"
    ]
}]
}


推荐答案

此错误的最常见原因是您的角色未设置为信任您的身份池。您应确认信任关系中列出的身份池ID与您正在使用的身份池匹配。

The most common reason for this error is your roles aren't set up to trust your identity pool. You should confirm that the identity pool id listed in your trust relationships matches the identity pool you are using.

有关Amazon Cognito中信任关系的更多信息,请参见我们的< a href = http://docs.aws.amazon.com/cognito/devguide/identity/concepts/role-trust-and-permissions/>开发人员指南。

More info on trust relationships in Amazon Cognito can be found in our developer guide.

这篇关于AWS Cognito无效身份池配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆