Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Cognito Invalid identity pool configuration

Tags:

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);     } }); 

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."} 

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

{ "Version": "2012-10-17", "Statement": [{     "Action": [         "mobileanalytics:PutEvents",         "cognito-sync:*"     ],     "Effect": "Allow",     "Resource": [         "*"     ] }] } 
like image 503
drfence Avatar asked May 24 '15 16:05

drfence


People also ask

What is identity ID Cognito?

You can retrieve a unique Amazon Cognito identifier (identity ID) for your end user immediately if you're allowing unauthenticated users or after you've set the login tokens in the credentials provider if you're authenticating users: var identityId = await credentials.GetIdentityIdAsync();

What is the difference between Cognito user pool and identity pool?

With a user pool, your app users can sign in through the user pool or federate through a third-party identity provider (IdP). Identity pools are for authorization (access control). You can use identity pools to create unique identities for users and give them access to other AWS services.

What is identity pool in AWS Cognito?

Amazon Cognito identity pools provide temporary AWS credentials for users who are guests (unauthenticated) and for users who have been authenticated and received a token. An identity pool is a store of user identity data specific to your account.


1 Answers

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.

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

like image 144
Bob Kinney Avatar answered Sep 26 '22 03:09

Bob Kinney