Add Microsoft Entra ID authentication (Members)
Learn how to use Microsoft Entra ID (Azure Active Directory) credentials to login to Umbraco as a member.
This article describes how to configure Microsoft Entra ID (Azure Active Directory/Azure AD) with Umbraco Users and Members.
Configuring Entra ID
Before your applications can interact with Entra ID B2C, they must be registered in a tenant that you manage. For more information, see Microsoft's Tutorial: Create an Azure Active Directory B2C tenant.
Installing the NuGet Package
You need to install the Microsoft.AspNetCore.Authentication.MicrosoftAccount
NuGet package. There are two approaches to installing the packages:
Use your favorite IDE and open up the NuGet Package Manager to search and install the packages.
Use the command line to install the package.
Entra ID Authentication for Users
Create a class called
BackofficeAuthenticationExtensions.cs
to configure the external login.Ensure to replace {your_client_id} and {your_client_secret} in the code with the values from the Entra ID tenant. If Entra ID is configured to use accounts in the organizational directory only (single tenant), you also have to specify the Token and AuthorizationEndpoint.
Update
ConfigureServices
method in theStartup.cs
file:Build and run the website. You can now login with your Entra ID credentials.
Entra ID Authentication for Members
Create a Member login functionality, see the Member registration and login article.
Create a class called
MemberAuthenticationExtensions.cs
to configure the external login.
To enable a member to link their account to an external login provider such as Entra ID in the Umbraco Backoffice, you have to implement a custom named configuration
MemberExternalLoginProviderOptions
for Members. Add the following code in theEntraIDB2CMembersExternalLoginProviderOptions.cs
file:Next, update
ConfigureServices
method in theStartup.cs
file:Build and run the website. Your members can now login with their Entra ID credentials.
Last updated