AZADB2C | Custom T&C in custom policy as a claim

Abhay Chandramouli 716 Reputation points

This is in continuation to

So I have a login page by az b2c where I have added a custom t&c using customizable ui of azure ad b2c. Since this t&c is added via html, how can I pass it as claims ?

I am using custom policy : passwordless phone number scenario

Azure Active Directory External Identities
{count} votes

Accepted answer
  1. AmanpreetSingh-MSFT 55,521 Reputation points

    Hi anonymous user • Thank you for reaching out.

    Below are the steps to get the T&C as a claim in the token after the user signs up by accepting the Terms & Conditions in the passwordless phone number custom policy scenario.

    1. In the B2C_1A_Phone_Email_Base file, add the T&C claim under the <Claims Schema> section. In the below example, I have named my T&C claim as TnCs.
      <ClaimType Id="TnCs">  
       <DisplayName>Terms of Service Consent</DisplayName>  
       <UserHelpText>I agree to the Amansi Corp terms of service.</UserHelpText>  
       <Enumeration Text="I agree to the terms of service." Value="4/21/2022" SelectByDefault="false" />  
    2. Look for the technical profile <TechnicalProfile Id="LocalAccountSignUpWithLogonPhoneNumber"> in your B2C_1A_Phone_Email_Base policy file and add below tags:
           <DisplayClaim ClaimTypeReferenceId="TnCs" Required="true" />  
       <OutputClaim ClaimTypeReferenceId="TnCs" Required="true" />  
    3. Open the B2C_1A_SignUpOrSignInWithPhone policy file and add it as output claim under <TechnicalProfile Id="PolicyProfile"> , as shown below:
      <TechnicalProfile Id="PolicyProfile">  
            <Protocol Name="OpenIdConnect" />  
       <OutputClaim ClaimTypeReferenceId="TnCs"/>  
            <SubjectNamingInfo ClaimType="sub" />  
    4. After the signup is completed, you will get the below claim in the token. You can set the value in step 1, where you define the claim.

    To see this in action, Click Here and signup for a new account.


    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