Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
Azure Active Directory B2C is no longer available as a service to new customers as of May 1, 2025. For more information, see Azure AD B2C: Frequently asked questions (FAQ).
Recommended path for new projects
Microsoft Entra External ID for customers is the recommended customer identity and access management (CIAM) solution for new ASP.NET Core applications, replacing Azure AD B2C with the latest identity platform features.
To get started with a new project, see Sign in users in a sample ASP.NET Core web app.
Migrate from Azure AD B2C to Entra External ID
To migrate an existing Azure AD B2C application to the newer platform, see Plan and execute a migration to Microsoft Entra External ID.
For detailed guidance on moving user accounts, including password migration strategies, see Migrating users to Microsoft Entra External ID.
Guidance for existing Azure AD B2C projects
Azure AD B2C remains supported for existing applications. Authoritative setup and configuration guidance is maintained in the Azure AD B2C documentation. The following articles cover the topics that ASP.NET Core developers typically need:
| Topic | Article |
|---|---|
| Create a tenant | Tutorial: Create an Azure AD B2C tenant |
| Register a web application | Tutorial: Register a web application in Azure AD B2C |
| Configure authentication in an ASP.NET Core app | Configure authentication in a sample ASP.NET Core web app |
| Enable multi-factor authentication | Enable MFA in Azure AD B2C |
ASP.NET Core integration checklist
After completing identity provider setup using the Entra or Azure AD B2C documentation, complete the following ASP.NET Core-specific steps:
Install NuGet packages: Add the
Microsoft.Identity.WebandMicrosoft.Identity.Web.UIpackages:dotnet add package Microsoft.Identity.Web dotnet add package Microsoft.Identity.Web.UIConfigure services in
Program.cs: CallAddMicrosoftIdentityWebAppto configure OpenID Connect authentication for the Microsoft identity platform, and callAddMicrosoftIdentityUIto add the required sign-in/sign-out UI components. For the full API reference, see the Microsoft Identity Web documentation.Add configuration: Add the
AzureADB2Csection inappsettings.jsonwith values that match your tenant and app registration. See Configure authentication in a sample ASP.NET Core web app for the complete schema and sample.
Additional resources
ASP.NET Core