Azure Ad B2c Conditonal Registration Details

Abhay Chandramouli 966 Reputation points
2022-04-18T08:59:02.983+00:00

Hi,
I am trying to make a sign up sign in flow where during user registration, I have a T&C Checkbox whose text value needs to change based on which url param is passed.
So for eg. if login.com?src=alpa is accessed then I want T&C text to be Tick the checkbox if you wanna get newsletters and if login.com?src=bepa then I want the text to be something else

Is that possible through azure ad b2c custom policies ?

Thanks

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,652 questions
0 comments No comments
{count} votes

Accepted answer
  1. AmanpreetSingh-MSFT 56,311 Reputation points
    2022-04-18T12:03:58.967+00:00

    Hi anonymous user • Thank you for reaching out.

    Yes, this can be done by using Custom Policy.

    For this purpose, you need to create multiple folders with your custom HTML file that contains different T&Cs. E.g., you can create two folders - 1. India and 2. USA with unified.html as shown below:

    1. For India: https://moviesdiag132.blob.core.windows.net/b2c/india/unified.html contains JavaScript that redirects to the T&Cinida page. (view page source)
    2. For USA: https://moviesdiag132.blob.core.windows.net/b2c/usa/unified.html contains JavaScript that redirects to the T&Cusa page. (view page source)

    Update the LoadUri under the api.signuporsignin and api.localaccountsignup content definitions as mentioned below:

    <LoadUri>https://moviesdiag132.blob.core.windows.net/b2c/{OAUTH-KV:src}/unified.html</LoadUri>  
    

    Update the RP (signup/signin) file with content definition parameter <Parameter Name="src">{OAUTH-KV:src}</Parameter> , as shown below:

    <RelyingParty>  
        <DefaultUserJourney ReferenceId="SignUpOrSignIn" />  
        <UserJourneyBehaviors>  
        <ContentDefinitionParameters>  
     <Parameter Name="src">{OAUTH-KV:src}</Parameter>  
     </ContentDefinitionParameters>  
              <ScriptExecution>Allow</ScriptExecution>  
        </UserJourneyBehaviors>  
        <TechnicalProfile Id="PolicyProfile">  
          <DisplayName>PolicyProfile</DisplayName>  
          <Protocol Name="OpenIdConnect" />  
          <OutputClaims>  
            <...>  
          </OutputClaims>  
          <SubjectNamingInfo ClaimType="sub" />  
        </TechnicalProfile>  
      </RelyingParty>  
    

    Finally, copy the run now endpoint and append that with the src=india or src=usa parameter, you will get different T&Cs. You can test it out by clicking on the below link where I have specified src=india. Click on the sign up now link and then the terms of use link.

    https://amsin.b2clogin.com/amsin.onmicrosoft.com/oauth2/v2.0/authorize?p=B2C_1A_SIGNUP_SIGNIN&client_id=a7eb03a0-c31a-4e9c-b07c-345b94604b17&nonce=defaultNonce&redirect_uri=https%3A%2F%2Fjwt.ms%2F&scope=openid&response_type=id_token&prompt=login&src=india

    If you change src to usa, you will get different T&Cs.

    Read more: Configure dynamic custom page content URI

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful