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

Notifications

Announcements

Community site session details

Community site session details

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

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

(0) ShareShare
ReportReport
Posted on by 2

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
    53,362 Super User 2025 Season 2 on at
     
    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.
     
  • ZK-11041953-0 Profile Picture
    2 on at
     
    I appreciate such a quick response and your expertise!
     
    Although I agree with roles requiring logging out/in being common practice; what I find frustrating is there is no way to check personas. That is why I feel that I am left with Web Roles for a solution (I could be, and hope that I am wrong, and that I am missing something).
    Even if permissions were assigned asynchronously, I would be ok with that, but not being able to provide a different UX for internal employees through SSO and external users through B2C seems like a missed opportunity.

    I can't believe I am the only one with this issue, so I'm crossing my fingers and holding out that a hero will find this thread. 😁
  • Suggested answer
    Fubar Profile Picture
    8,346 Super User 2025 Season 2 on at
    The portal doesn't really separate internal vs external users (or not in the way you want) just deals with  the trust that you have established with Identity Providers (they are all considered external identity providers).
     
    If you know who the internal people (contacts) are ahead of time (which i don't think fits your scenario) you can assign web role(s) that will be active immediately by creating an Invitation including the Web Role(s) and sending the invite to them and then when they redeem the invitation they will have the access of those roles straight away.
     
    Similarly, if you know who the contacts are ahead of time I have also seen people automate the assignment of Web Roles when the contact is created/updated. You can do this in your scenario on External Identity create but that assignment of Web Role will not be available immediately.
     
    Another alternative is to setup 2 portals one for internal users the other for external.

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
Fubar Profile Picture

Fubar 70 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 55

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard