在 ASP.NET Core 2.1 中, Microsoft.AspNetCore.Authentication.AzureAD.UI 和 Microsoft.AspNetCore.Authentication.AzureADB2C.UI 包提供与 Azure Active Directory(Azure AD)和 Azure Active Directory B2C(Azure AD B2C)身份验证的集成。 这些包提供的此功能基于 Azure AD v1.0 终结点。
在 ASP.NET Core 5.0 及更高版本中, Microsoft.Identity.Web 包提供与 Azure AD 和 Azure AD B2C 身份验证的集成。 此包基于 Microsoft 身份平台,该平台以前被称为 Azure AD v2.0 端点。 因此,Microsoft.AspNetCore.Authentication.AzureAD.UI
和Microsoft.AspNetCore.Authentication.AzureADB2C.UI
包中的旧 API 已被弃用。
有关讨论,请参阅 GitHub 问题 dotnet/aspnetcore#25807。
已引入的版本
5.0 预览版 8
旧行为
API 未标记为已过时。
新行为
API 标记为已过时。
更改原因
Azure AD 和 Azure AD B2C 身份验证功能已迁移到 Microsoft.Identity.Web
提供的 Microsoft 身份验证库(MSAL)API。
建议的措施
Microsoft.Identity.Web
遵循 Web 应用和 Web API 的 API 指南。
受影响的 API
- Microsoft.AspNetCore.Authentication.AzureADAuthenticationBuilderExtensions
- Microsoft.AspNetCore.Authentication.AzureAD.UI.AzureADDefaults
- Microsoft.AspNetCore.Authentication.AzureAD.UI.AzureADOptions
- Microsoft.AspNetCore.Authentication.AzureADB2CAuthenticationBuilderExtensions
- Microsoft.AspNetCore.Authentication.AzureADB2C.UI.AzureADB2CDefaults
- Microsoft.AspNetCore.Authentication.AzureADB2C.UI.AzureADB2COptions