To test the policy, follow these steps:
- Run the B2C_1A_Demo_SignUpSignIn_DomainAllowlist policy.
- Select the Sign-up now link.
- In the email field type any email address except @outlook.com, @live.com, or @gmail. For example type david@fabrikam.com, or emily@contoso.com. Then select Send verification code. You should get the following error message: Please enter a email address from one of the following domains: outlook.com, live.com, or gmail.com..
- Change the email address to one of the allowed domains @outlook.com or @outlook.com, @live.com, or @gmail. This time you will be able to send the verification code.
The email claim is configured with a regular expression restriction. The error message is configure in the localization part of the policy.
This policy demonstrates how to validate the email address domain name against a list of allowed domains.
Note: This sample policy is based on SocialAndLocalAccounts starter pack. All changes are marked with Demo: comment inside the policy XML files. Make the necessary changes in the Demo action required sections.