Demonstrate how to use a display control to conditionally process on the users decision to verify their account via Email or SMS verification code.
To test the policy, follow these steps:
- If you don't have an account, create a local account with your email address, using the B2C_1A_Demo_SignUp_SignIn_PasswordReset_EmailOrPhone policy. This policy is based on the SocialAndLocalAccountsWithMfa that required users to register their phone number.
- Run the B2C_1A_Demo_PasswordReset_EmailOrPhone policy to reset the password.
- Perform the following test:
- Type your email and select Continue. Then, select to send the verification code to your email. Provide the verification code that you received and select continue to reset the password.
- Repeat the process, but this time select to send the verification code to your phone.
-
You can automate the pre requisites by visiting the setup tool if you already have an Azure AD B2C tenant. Some policies can be deployed directly through this app via the Experimental menu.
-
You will require to create an Azure AD B2C directory.
-
To use the sample policies in this repo, follow the instructions here to setup your AAD B2C environment for Custom Policies.
- Read the users profile once they provide their email address. This will provide their phone number used to Sign Up.
- Use a displayControl to display the user a radio box selection on whether to verify their account via Email or Phone.
- The displayControl uses preconditions on the SendCode and VerifyCode actions to control the ValidationClaimsExchangeTechnicalProfile based on the users selection on whether to use phone or email to verify their account. That decision is held in the claim mfaType, which acts as the radio box.
Use Stack Overflow to get support from the community. Ask your questions on Stack Overflow first and browse existing issues to see if someone has asked your question before. Make sure that your questions or comments are tagged with [azure-ad-b2c]. If you find a bug in the sample, please raise the issue on GitHub Issues. To provide product feedback, visit the Azure Active Directory B2C Feedback page.
This sample policy is based on SocialAndLocalAccountsWithMFA starter pack. All changes are marked with Sample: comment inside the policy XML files. Make the necessary changes in the Sample action required sections.