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.
- 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> <DataType>string</DataType> <UserHelpText>I agree to the Amansi Corp terms of service.</UserHelpText> <UserInputType>CheckboxMultiSelect</UserInputType> <Restriction> <Enumeration Text="I agree to the terms of service." Value="4/21/2022" SelectByDefault="false" /> </Restriction> </ClaimType>
- Look for the technical profile
<TechnicalProfile Id="LocalAccountSignUpWithLogonPhoneNumber">
in your B2C_1A_Phone_Email_Base policy file and add below tags:<DisplayClaims> ... <DisplayClaim ClaimTypeReferenceId="TnCs" Required="true" /> </DisplayClaims> <OutputClaims> ... <OutputClaim ClaimTypeReferenceId="TnCs" Required="true" /> </OutputClaims>
- Open the B2C_1A_SignUpOrSignInWithPhone policy file and add it as output claim under
<TechnicalProfile Id="PolicyProfile">
, as shown below:<TechnicalProfile Id="PolicyProfile"> <DisplayName>PolicyProfile</DisplayName> <Protocol Name="OpenIdConnect" /> <OutputClaims> ... <OutputClaim ClaimTypeReferenceId="TnCs"/> </OutputClaims> <SubjectNamingInfo ClaimType="sub" /> </TechnicalProfile>
- 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.