amazon-archives / aws-cognito-angular-quickstart

An Angular(v5)-based QuickStart single-page app utilizing Amazon Cognito, S3, and DynamoDB (Serverless architecture)
https://cognito.budilov.com
Apache License 2.0
689 stars 300 forks source link

(NotAuthorizedException) when calling the SetIdentityPoolRoles operation #35

Closed quantuminformation closed 7 years ago

quantuminformation commented 7 years ago

I ran into this error: An error occurred (NotAuthorizedException) when calling the SetIdentityPoolRoles operation: Access to Role 'arn:aws:iam::180971085012ole/quantumjs-unauthenticated-role' is forbidden. When running

# Update cognito identity with the roles
# If this command gives you an error, associate the roles manually
aws cognito-identity set-identity-pool-roles --identity-pool-id $identityPoolId --roles authenticated=arn:aws:iam::$AWS_ACCOUNT:role/$ROLE_NAME_PREFIX-authenticated-role,unauthenticated=arn:aws:iam::$AWS_ACCOUNT:role/$ROLE_NAME_PREFIX-unauthenticated-role --region $REGION

Can someone explain how to do this in a bit more detail?

vbudilov commented 7 years ago

Hi @QuantumInformation ,

Try starting from scratch, clone the latest repo and run the setup script -- it has been updated to automate all of the setup elements. Otherwise, read the following docs: http://docs.aws.amazon.com/cognito/latest/developerguide/setting-up.html

Vladimir Budilov

quantuminformation commented 7 years ago

I have the latest version of the script. I went through all the previous steps and validated them on the console (Except I wasn't sure where to to find the part on the console which shows the identity-pool.

The script says # If this command gives you an error, associate the roles manually but not really sure what to do in the console.

vbudilov commented 7 years ago

Take a look at the documentation that I linked to. You need to associate the appropriate role to the cognito identity. Either way, if rerun the the script it should create everything automatically.

vbudilov commented 7 years ago

Closing due to inactivity.