Search code examples
asp.net-mvcsingle-sign-onazure-ad-b2cpowerapps

Azure B2C SSO for my web application and powerapps application not working


I have configured my Azure B2C to enable SSO feature, after enable when I login into my web application and redirect to power apps application it does not show as logged in instead it is showing for SIGN IN and when click on that button it directly logged my account and create cookie of .AspNet.ApplicationCookie and show account details. Both web application and power app have different domains. Please help me what I am missing


Solution

  • That’s expected, since you have to send the user to AAD B2C to check if they are logged in. The user must perform an action in App2 to be sent to B2C to perform the login or SSO.

    You could perform a check on page load using a hidden iframe and if the login works, do something to update the page to reflect that, otherwise silently fail. https://learn.microsoft.com/en-us/azure/active-directory-b2c/embedded-login?pivots=b2c-user-flow

    This would require coding in the authentication with MSAL into the app.