This sample allows dynamically detecting whether a user can sign in or sign up. The user enters their email and selects Sign-in. If the account exists, the user is asked to verify their password. Otherwise, if the account does not exist, the user goes through a sign up flow.
To test the policy, complete the following steps:
- Run the B2C_1A_Demo_SignUp_SignIn_Dynamic policy. In the sign-up or sign-in page provide an account that doesn't exists in the directory. Select Sign-in and Azure AD B2C will take you to the sign-up page (the email is read only).
- Run the B2C_1A_Demo_SignUp_SignIn_Dynamic policy again. In the sign-up or sign-in page provide the email address that you used in the previous step. Select Sign-in and Azure AD B2C will ask you to provide the password.
- Run the B2C_1A_Demo_SignUp_SignIn_Dynamic policy again. In the sign-up or sign-in page select the Sign-up now link. Azure Azure AD B2C will take you to the sign-up page where you provide and verify your email address.
-
You can automate the pre requisites by visiting the setup tool if you already have an Azure AD B2C tenant. This sample can be Quick deployed after the pre requisites are automated.
-
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.
This sample policy is based on Social and LocalAccounts with MFA starter pack. All changes are marked with Sample: comment inside the policy XML files. Make the necessary changes in the Sample action required sections.