【发布时间】:2021-10-11 05:54:59
【问题描述】:
在 startup.cs 文件中,我尝试使用以下几行将 Azure AD B2C 连接到我的 .Net Core 5 Web-API 项目,然后是 GitHub 存储库 Here。但它不接受我的 .Net Core 5+ React 模板项目中的 AddMicrosoftIdentityWebApp 预定义方法。我哪里做错了?
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApi(Configuration.GetSection("AzureAdB2C"));
我也尝试过 OpenId 方案和以下方法。
services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApp(Configuration.GetSection("AzureAdB2C"));
【问题讨论】:
-
您安装了
Microsoft.Identity.Web软件包吗?代码文件中有using Microsoft.Identity.Web;吗? -
谢谢大卫G
标签: c# authentication azure-active-directory azure-ad-b2c asp.net-core-5.0