【问题标题】:AuthenticationBuilder does not contain a definition for "AddMicrosoftIdentityWebApp"AuthenticationBuilder 不包含“AddMicrosoftIdentityWebApp”的定义
【发布时间】: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


【解决方案1】:

我还没有安装下面给出的包!。

Microsoft.Identity.Web;

【讨论】:

    猜你喜欢
    • 2019-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多