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?

已提問 4 個月前檢視次數 130 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南