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?

preguntada hace 4 meses130 visualizaciones
No hay respuestas

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas