Set up sign-in for a specific Azure Active Directory organization in Azure Active Directory B2C
This feature is in public preview. Do not use the feature in production environments.
To use an Azure Active Directory (Azure AD) as an identity provider in Azure AD B2C, you need to create an application that represents it. This article shows you how to enable sign-in for users from a specific Azure AD organization using a user flow in Azure AD B2C.
Create an Azure AD app
To enable sign-in for users from a specific Azure AD organization, you need to register an application within the organizational Azure AD tenant, which is not the same as your Azure AD B2C tenant.
Sign in to the Azure portal.
Make sure you're using the directory that contains your Azure AD tenant. Select the Directory and subscription filter in the top menu and choose the directory that contains your Azure AD tenant. This is not the same tenant as your Azure AD B2C tenant.
Choose All services in the top-left corner of the Azure portal, and then search for and select App registrations.
Select New registration.
Enter a name for your application. For example,
Azure AD B2C App.
Accept the selection of Accounts in this organizational directory only for this application.
For the Redirect URI, accept the value of Web, and enter the following URL in all lowercase letters, where
your-B2C-tenant-nameis replaced with the name of your Azure AD B2C tenant. For example,
All URLs should now be using b2clogin.com.
Click Register. Copy the Application (client) ID to be used later.
Select Certificates & secrets in the application menu, and then select New client secret.
Enter a name for the client secret. For example,
Azure AD B2C App Secret.
Select the expiration period. For this application, accept the selection of In 1 year.
Select Add and copy the value of the new client secret that is displayed to be used later.
Configure Azure AD as an identity provider
Make sure you're using the directory that contains Azure AD B2C tenant. Select the Directory and subscription filter in the top menu and choose the directory that contains your Azure AD B2C tenant.
Choose All services in the top-left corner of the Azure portal, and then search for and select Azure AD B2C.
Select Identity providers, and then select Add.
Enter a Name. For example, enter
Contoso Azure AD.
Select Identity provider type, select Open ID Connect (Preview), and then click OK.
Select Set up this identity provider
For Metadata url, enter the following URL replacing
your-AD-tenant-domainwith the domain name of your Azure AD tenant. For example
For Client ID, enter the application ID that you previously recorded and for Client secret, enter the client secret that you previously recorded.
Optionally, enter a value for Domain_hint. For example,
ContosoAD. This is the value to use when referring to this identity provider using domain_hint in the request.
Select Map this identity provider's claims and set the following claims:
- For User ID, enter
- For Display Name, enter
- For Given name, enter
- For Surname, enter
- For Email, enter
- For User ID, enter
Click OK, and then click Create to save your configuration.