.NET Framework 4.7.2启动身份验证逻辑



如何在.NET Framework 4.7.2的启动文件中编写此.NET Core 3.1身份验证代码?

services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme(.AddMicrosoftIdentityWebApp(Configuration.GetSection("AzureAd"((;

请使用以下代码。

services.AddAuthentication(sharedOptions =>
{
sharedOptions.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
})
.AddAzureAdB2C(options => Configuration.Bind("Authentication:AzureAdB2C", options))
.AddCookie();

有一个GitHub示例可以帮助您使用.Net Core 3.1 进行Azure AD B2C OpenIDConnent身份验证

我决定将我的项目从框架迁移到.net core 3.1

相关内容

最新更新