Hello,
Hi currently I am creating a power pages which requires authentication and has custom roles which defines what pages and resources a user can access. Here is the scenario.
- We are using a 3rd party IDP Service which we have added using OpenID in power pages as an identify provider.
- We are not using self registration.
- Currently Authentication from our power pages to the IDP works and a Contact record is created.
- Account creation is done where we manually create the account and assign custom roles with specific roles assigned to that account on the 3rd party IDP side. The idea this would sync these roles our power pages and other platforms (single place for user management)
- We created matching custom roles in power pages (where names match keys on the IDP side).
- Certain power pages and resources are accessible by users who belong to that role.
- In the JWT token returned from the IDP after the user successfully logs in, it contains in the claims, a JSON property "roles" which contains the JSON array of all the roles that the user has assigned (circled in white below of "JWT explorer" debugging extension, there is 2 roles).

Question, since this is using OpenID with power pages, is there a way to sync the claims roles so that the matching PP web roles are added/updated to the contact? The roles are being returned in the token. I am wondering if I am missing something or if there is an easy way of doing this?
Thanks