web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Automatically Assign W...
Power Pages
Unanswered

Automatically Assign Web Roles to Contact through OpenID claims in JWT Token

(0) ShareShare
ReportReport
Posted on by 2

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).

MelR_0-1694473790009.png

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

 

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    I haven't done, but what I would try is:

    • Map the claims against a contact column (text)
    • Trigger a plugin or something (real-time) that will read that field on the creation of the contact o external identity, and then find/assign the web roles to the contact 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 33

#2
sannavajjala87 Profile Picture

sannavajjala87 28 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 22 Super User 2026 Season 2

Last 30 days Overall leaderboard