Azure AD B2C Integration SSO on multiple B2C apps without prompt/redirection

Patil, Sagar 31 Reputation points
2022-10-17T19:22:57.627+00:00

Hi Team,

We would like to understand how azure B2c can be configured for SSO
if application [A] abc.domain.com
and [B] xyx.domain.com are configured under same tenant

application [A] is using custom policies for Sign in and Sign up and using MSAL.js library to get id token etc with azure B2C
application [B} using out of box user flows for Sign in and using open source angular library for triggering Oauth flow
with azure B2C
library url - https://github.com/manfredsteyer/angular-oauth2-oidc

Both applications will have interactive Sign in page to get users email and password.
Expectation is azure B2C will just handle SSO out of box with default seettings. i.e. if user logs in any of application A or B then
user will not be prompted if they are in same browser session or new tabs or opens application in new browser window (same browser)

we know out of box Azure B2C has SSO configured on tenant level. So do we have to do anything specific to achieve
above result of SSO?

also both applications are storing their Id token in different cookies strongly typed to their own domain because they are using different client side libraries but does this impact azure B2C SSO behavior ?

We couldn't find anything specific on how azure B2C SSO works in detail across tenant apart from below link. which wasn't much helpful about what needs to be done if everything is configured out of box?
https://learn.microsoft.com/en-us/azure/active-directory-b2c/session-behavior?pivots=b2c-user-flow

Cheers
Sagar

Microsoft Security Microsoft Entra Microsoft Entra External ID
Microsoft Security Microsoft Entra Microsoft Entra ID
{count} vote

Accepted answer
  1. Akshay-MSFT 17,951 Reputation points Microsoft Employee Moderator
    2022-10-18T10:57:46.813+00:00

    Hello @Patil, Sagar ,

    For configuring tenant wide SSO via user flow https://learn.microsoft.com/en-us/azure/active-directory-b2c/session-behavior?pivots=b2c-user-flow#configure-the-user-flow have "SSO Configuration" set to "Tenant" and "Enable keep me signed in session" to "Yes"

    For Custom policy as per https://learn.microsoft.com/en-us/azure/active-directory-b2c/session-behavior?pivots=b2c-custom-policy#configure-the-custom-policy in SignUpOrSignin.xml Change the value of the Scope attribute to "Tenant" Application, or Policy. As per https://learn.microsoft.com/en-us/azure/active-directory-b2c/cookie-definitions#cookies, the cookie "x-ms-cpim-sso:{Id}" must be set"persistent" to Enable Keep me signed in.

    However, SSO will not work by mixing userflows and custom policies. It is because the custom policy is using different technical profile names, or session management names compared to the user flow behind the scenes.

    Do let me know if you have any queries in the comments section.

    Thanks,
    Akshay Kaushik

    Please "Accept the answer" and "Upvote" if the above-mentioned suggestion works as per your business need. This will help us and others in the community as well.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Patil, Sagar 31 Reputation points
    2022-10-25T09:11:48.043+00:00

    Hi @Akshay-MSFT ,

    I saw you updated original answer with below text -

    However, SSO will not work by mixing user flows and custom policies. It is because the custom policy is using different technical profile names, or session management names compared to the user flow behind the scenes.

    Could you please elaborate more on this?
    application B is using azure B2C pre defined user flows from portal but application A is using custom profiles
    which are almost same as default journeys with very small UI tweaks.
    and we have ensured to edit XML to add Tenant level SSO . see below for SignInPasswordReset profile

    <RelyingParty>
    <DefaultUserJourney ReferenceId="SignInPasswordReset" />
    <UserJourneyBehaviors>
    <SingleSignOn Scope="Tenant" KeepAliveInDays="7"/>
    <SessionExpiryType>Absolute</SessionExpiryType>
    <SessionExpiryInSeconds>1200</SessionExpiryInSeconds>
    <JourneyFraming Enabled="true" Sources="https://weu-dev-abcd-xyz.azurewebsites.net https://localhost:3000 https://localhost https://abcdc.dev.local" />
    <ScriptExecution>Allow</ScriptExecution>
    </UserJourneyBehaviors>
    <TechnicalProfile Id="PolicyProfile">
    <DisplayName>PolicyProfile</DisplayName>
    <Protocol Name="OpenIdConnect" />
    <OutputClaims>
    BASIC CLAIM CONFIGURATIONS
    </OutputClaims>
    <SubjectNamingInfo ClaimType="sub" />
    </TechnicalProfile>
    </RelyingParty>


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.