Azure B2C is a cloud identity management solution that allows you to add authentication and authorization capabilities to your applications. It provides a secure and scalable way to manage user identities and access control. One of the features of Azure B2C is the ability to allow users to sign up using their social media accounts such as Facebook, Google, or Microsoft. In this article, we will discuss how to configure Azure B2C custom policies to allow signup only with social signup.
What are custom policies?
Custom policies in Azure B2C allow you to define the behavior of the identity experience framework (IEF) by using XML-based policy language. With custom policies, you have more control over the user journey and can define complex authentication and authorization flows. You can create custom policies to support various scenarios, such as social sign-in, multi-factor authentication, and more.
Configuring Azure B2C custom policies
To configure Azure B2C custom policies for signup only with social signup, follow these steps:
Step 1: Create a custom policy
First, you need to create a custom policy in your Azure B2C tenant. To do this, navigate to the Azure portal and open your Azure B2C tenant. Then, go to the "Identity Experience Framework" section and click on "Policies".
Click on the "New custom policy" button to create a new custom policy. Give your policy a name and select the "Identity providers" template. This template allows you to configure the identity providers (social sign-in providers) that users can use to sign up.
Step 2: Configure identity providers
Once you have created the custom policy, you need to configure the identity providers. In the custom policy editor, you will see a section called "Technical profiles". This section contains the technical profiles for different identity providers.
To configure the identity providers, you need to modify the technical profiles for each provider. For example, if you want to allow users to sign up using their Facebook account, you need to modify the technical profile for Facebook.
Within each technical profile, you can specify the claims that you want to collect from the user and the claims that you want to return to the application. You can also specify the scopes and permissions required for each identity provider.
Step 3: Enable social sign-up
To enable social sign-up, you need to modify the user journey in your custom policy. The user journey defines the steps that a user goes through during the sign-up process.
In the user journey, you can add a step to display the social sign-in buttons and allow the user to choose a social sign-in provider. You can also add a step to collect additional information from the user, such as their email address or phone number.
By default, Azure B2C allows users to sign up using either a local account (username and password) or a social account. To restrict sign-up to only social accounts, you can remove the step for local account sign-up in the user journey.
Step 4: Test your custom policy
Once you have configured your custom policy, you can test it to ensure that it is working as expected. You can use the Azure AD B2C user flows testing experience to test your custom policy.
In the testing experience, you can simulate the user journey and see how the user experience will look like for your users. You can also view the claims that are returned by the custom policy and verify that they are correct.
By following the steps outlined in this article, you can configure Azure B2C custom policies to allow signup only with social signup. Custom policies provide a flexible and powerful way to customize the user journey and behavior of Azure B2C. With custom policies, you can create a seamless and secure signup experience for your users.
References
| Reference | Link |
|---|---|
| Azure B2C documentation | https://docs.microsoft.com/en-us/azure/active-directory-b2c/ |
| Azure B2C custom policies overview | https://docs.microsoft.com/en-us/azure/active-directory-b2c/custom-policy-overview |
| Azure B2C custom policies reference | https://docs.microsoft.com/en-us/azure/active-directory-b2c/custom-policy-reference |