Skip to content

Latest commit

 

History

History

claims

Claims unit tests

This folder contains unit tests for Azure AD B2C claims. For more information, check out the ClaimsSchema article.

User input types

Azure AD B2C supports various user input types, such as a textbox, password, and dropdown list that can be used when manually entering claim data for the claim type. This unit test shows the types of UserInputType.

live demo Live demo   Quick deploy Quick deploy   policy Policy   documentation Documentation

Simple mask

The claim Simple mask indicates that the text mask is applied to the leading portion of a string claim. This unit test shows how to use the claim mask type of Simple with verity of formats.

Provide a phone number, then select Continue. The ExperimentalTechnicalProfile technical profile calls the CopyPhoneNumber claims transformations to copy the phone number you provided inputPhoneNumber into the outputPhoneNumber claims. The next page renders the outputPhoneNumber claims with the corresponding format.

live demo Live demo   Quick deploy Quick deploy   policy Policy   documentation Documentation

Regex mask

The claim Regex mask indicates that a regular expression is applied to the string claim as whole. This unit test shows how to use the claim mask type of Regex with verity of formats.

Provide an email address, then select Continue. The ExperimentalTechnicalProfile technical profile calls the CopyEmail claims transformations to copy the email address you provided inputEmail into the outputEmail claims. The next page renders the outputEmail claims with the corresponding format.

live demo Live demo   Quick deploy Quick deploy   policy Policy   documentation Documentation

Regex restriction pattern

The claim Regex restriction pattern defines a regular expression that claim must match in order to be valid.

live demo Live demo   Quick deploy Quick deploy   policy Policy   documentation Documentation

Enumeration restriction

The claim Restriction enumeration defines available options for the user to select for a claim in the user interface, such as a value in a CheckboxMultiSelect, DropdownSingleSelect, or RadioSingleSelect. This unit test shows the usage of restriction enumeration in a claim definition and localization.

This unit test includes the following claims:

  • Dropdown1 a string dropdown claim. It defines the restriction enumeration options in the claim definition. The options will be presented for all languages.
  • Dropdown2 a string dropdown claim. It defines the restriction enumeration options localization section of the policy (Spanish and Hindi). For other languages the options from the claim definition will be presented.
  • Dropdown3 a string dropdown claim. It defines the restriction enumeration options localization section of the policy (Spanish and Hindi). For other languages the dropdown list will be empty.

live demo Live demo (default)   live demo Spanish Live demo (Spanish)   live demo Hindi Live demo (Hindi)   live demo German Live demo (German)   Quick deploy Quick deploy   policy Policy   documentation Documentation