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

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / [Help] Synchronous Web...
Power Pages
Unanswered

[Help] Synchronous Web Role Assignment in Power Pages Based on Identity Provider (Entra SSO vs B2C)

(0) ShareShare
ReportReport
Posted on by

Hi all,

I need a synchronous way to assign web roles in Power Pages at sign-in based on identity provider:

  • Microsoft Entra (SSO) → Employee web role
  • Microsoft Entra B2C → External web role
This is required to immediately show/hide content and enforce Table Permissions / Web Page Access Control Rules. I cannot use asynchronous options (e.g., Power Automate) because they force a log out/in before roles take effect, which is unacceptable UX.
 
What I've tried:
  • Liquid checks to detect provider 
    • (Good for UI only, not security and also not sustainable since the check would need to be done on every page new & old)
  • Background jobs/flows
    • (Too slow; roles apply only after re-login)
  • Default role assignment at registration
    • (Doesn't handle provider-based logic)
Questions:
  1. Is there a supported way to assign/resolve web roles synchronously at authentication based on the identity provider?
  2. Can Power Pages map claims (e.g., identityprovider, iss, or a custom B2C claim like external=true) to web roles so they’re active immediately?
  3. Are there authentication event hooks or custom handlers that run synchronously to set roles before the first page renders?
Pseudocode - Desired Behavior:
OnAuthenticationSuccess(user):
    idp = claims['http://schemas.microsoft.com/identity/claims/identityprovider']
    if idp == 'entra-id':
        principal.AddRole('Employee')
    else if idp == 'entra-b2c':
        principal.AddRole('External')
    // role should be active in the current session immediately
If you’ve achieved this, could you share:
  • Exact configuration (claim types, site settings, mapping steps)
  • Whether it worked synchronously without re-login
  • Any gotchas (caching, timing, first-request behavior)
Thanks Power Pages Community!
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    52,970 Super User 2025 Season 2 on at
    [Help] Synchronous Web Role Assignment in Power Pages Based on Identity Provider (Entra SSO vs B2C)
     
    Just to clarify something in general, having the person log in / out is pretty standard across any auth/auth scenario because Roles and Permissions do not always take effect without logging in or out but it's not a Power Automate thing, especially as Claims versus Roles, being different things, don't map today.
     
    The other issue is there are not many ways to "block" setting aside why you want to block (which I do understand).
     
    Essentially nothing we give you will guarantee immediately assignment (meaning no logging in or out), whether you call Azure Functions, or Plugins I am unaware of any way to force a guarantee immediately affect.
     
    Maybe one of the others has a way, I am just not aware of one.
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 66

#2
Fubar Profile Picture

Fubar 45 Super User 2025 Season 2

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 31 Super User 2025 Season 2

Last 30 days Overall leaderboard