Cognito - Dynamic Role

0

Hi,
i'm implementing an application in the IoT domain. Every user would be able to communicate with his personal provider, so i would like to have temporary credentials, using Identity Pools, that permit the user to publish and subscribe only for the topic associate with his device.

There is a way to return temporary credentials based on a particular user? I would like federate Cognito User Pool with Identity Pool and use a way to have dynamic roles. So if the user X can only publish and subscribe the topic Y, i would like to return the temporary credentials linked to a role that permit only to operate with this topic.

Have i to use the choose of role based on rule?

Thanks in advance.

Marco G.

Edited by: MarcoG on May 18, 2019 3:45 PM

MarcoG
asked 5 years ago314 views
2 Answers
0

Hi,
we have used the AttachPolicy method with Cognito User Pool and Cognito Identity Pool. In this way we can attach dynamically policy to user session.

Thanks.

MarcoG
answered 5 years ago
0

Thank you for reaching out. I understand that you are working on an IoT application where each user needs to communicate with their personal provider. To enable this, you are looking for a solution to obtain temporary credentials through Identity Pools. These credentials should allow users to publish and subscribe only to the topics associated with their respective devices.

In regards to your question, yes, there is a way to retrieve temporary credentials based on a specific user. You can achieve this by federating the Cognito User Pool with the Identity Pool and implementing dynamic roles. By doing so, you can assign roles to users based on their specific permissions and access requirements. For instance, if user X is limited to publishing and subscribing to topic Y, you can configure the temporary credentials to be associated with a role that grants permissions solely for that topic.

To accomplish this, you can by using rule-based mapping to assign roles to users within the Identity Pool configuration. By defining rules based on your specific requirements, you can dynamically assign roles to users when they authenticate and obtain temporary credentials accordingly.

https://docs.aws.amazon.com/cognito/latest/developerguide/role-based-access-control.html

profile pictureAWS
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions