How can I switch roles using Amplify?

0

Hello

Cognito User Pool allows to add user to multiple Groups. Each group can have an IAM Role assigned. I have configured two groups: Admin (precedence: 1) and Operator (precedence: 10) . Each group has an IAM Role assignment.

I have Cognito Identity Pool configured with Cognito User Pool as an Identity Source and I have "Role from Token" selected.

In my Vue app, I have Amplify configured to use Cognito User and Identity Pools.

I can sign in with my user credentials and my app (via Amplify) is using AWS temporary credentials related to cognito:prefered_role (the one assigned to Cognito group with the lowest precedence). I can see "cognito:groups" attribute in ID token generated by Cognito with all Groups my user is a member of, and "cognito:roles" with all IAM Roles available for this user.

The question is: How can I switch to other roles using apmplify?

Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen