The sample application makes use of two types of policies: a sign-in policy, and a resource owner password credentials policy (ROPC). Users are expected to be pre-added to the Azure Acitve Directory B2C tenant, and therefore there is no need for a sign-up policy.
- You must have an existing Azure subscription.
- You must have an existing Azure Active Directory B2C tenant. See Create an Azure Active Directory B2C tenant if you dont.
The following are suggested tasks, as these may be needed later.
- Record your Sign-in policy name
- Record your ROPC policy name
- Add user attribute PolicyId to Sign-in policy
- Add user attribute PolicyId to ROPC policy
The sign-in user flow handles sign-in experiences with a single configuration. Users of your application are led down the right path depending on the context.
- Sign in to the Azure portal.
- Select the Directory + Subscription icon in the portal toolbar, and then select the directory that contains your Azure AD B2C tenant.
- In the Azure portal, search for and select Azure AD B2C.
- Under Policies, select User flows, and then select New user flow.
- On the Create a user flow page, select the Sign in user flow.
- Under Select a version, select Recommended, and then select Create. (Learn more about user flow versions.)
- Enter a Name for the user flow - signin
- For Identity providers, select Email signup.
- For User attributes and claims, select Show more and choose as many attributes that will be returned as
claims
as required, and click on Ok.- Display Name - This is used by the Chat as the users display name and required
- Click Create to add the user flow. A prefix of B2C_1 is automatically prepended to the name.
The Sign in using resource owner password credentials (ROPC) flow enables a user with a local (B2C) account to sign-in directly in native applications (no browser required).
- Sign in to the Azure portal.
- Select the Directory + Subscription icon in the portal toolbar, and then select the directory that contains your Azure AD B2C tenant.
- In the Azure portal, search for and select Azure AD B2C.
- Under Policies, select User flows, and then select New user flow.
- On the Create a user flow page, select the Sign in using resource owner password credentials (ROPC) user flow.
- Under Select a version, select Preview, and then select Create.
- Enter a Name for the user flow - ropc
- For User attributes and claims, select Show more and choose as many attributes that will be returned as
claims
as required, and click on Ok.- Display Name - This is used by the Chat as the users display name and required
- Click Create to add the user flow. A prefix of B2C_1 is automatically prepended to the name.