Replies: 2 comments 2 replies
-
Hi @TWDBrob, Does the role associated with your identity pool have a policy that allows for SNS:ListTopics?
$ aws cognito-identity get-identity-pool-roles --identity-pool-id us-east-1:REDACTED
{
"IdentityPoolId": "us-east-1:REDACTED",
"Roles": {
"authenticated": "arn:aws:iam::REDACTED:role/REDACTED",
"unauthenticated": "arn:aws:iam::REDACTED:role/REDACTED"
}
}
This would tell you if the role has the necessary permission to run
Im not sure what you mean by "access" a topic. You can use Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
-
We use SNS for a list of topics to which a user can subscribe after logging using Cognito (we keep the subscription ARNs in a Cognito identity dataset). I was trying to list the topics and am getting an AuthorizationErrorException. Here's the code:
The jwt token is created when the user logs in via Cognito and the IdentityPoolId is something like "us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", if it matters. The error says AuthorizationErrorException: User: arn:aws:sts::xxxxxxxx:assumed-role/Cognito_xxxxxxxxAuth_Role/CognitoIdentityCredentials is not authorized to perform: SNS:ListTopics on resource: arn:aws:sns:us-east-1:xxxxx:* because no identity-based policy allows the SNS:ListTopics action. If that's the case, how should the request be authorized? I am rewriting some old code which used (I think) v2 and just called AWS.SNS() from the SDK to perform subscribe and unsubscribe actions. This is the only configuration I can see going on there:
By the way, why is the CreateTopicCommand used to access a Topic that already exists?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions