linux 上的 .net 核心示例应用程序缺少 OpenIdConnectOptions
OpenIdConnectOptions Missing from .net core sample application on linux
我正在尝试按照本教程在 .NET 核心 Web 应用程序中进行 Azure AD 身份验证:
我得到这个错误:
The type or namespace name 'OpenIdConnectOptions' could not be found (are you missing a using directive or an assembly reference?)
我正在使用 Linux 并没有问题生成和构建基本模板,问题似乎出现在教程说添加此行的地方:
services.Configure<OpenIdConnectOptions>(AzureADDefaults.OpenIdScheme, options =>
{
options.Authority = options.Authority + "/v2.0/";
options.TokenValidationParameters.ValidateIssuer = false;
});
我试过添加包(半随机)例如:
Microsoft.IdentityModel.Protocols.OpenIdConnect
Microsoft.Owin.Security.OpenIdConnect
无济于事,因为错误仍然存在,我遇到了新问题,例如:
Error: Package 'Microsoft.Owin 4.0.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.
我不确定我是否缺少身份验证的一些基础知识和 linux 上的 运行 .net 核心,我是新手,只是想通过一个工作演示来启动确实做了一些事情:)
我还没有检查 linux,但是您缺少的 nuget 包应该是由以下项目的 ASP.NET Core 生成的:https://github.com/aspnet/AADIntegration。您是否尝试更新 ASP.NET Core 的最新 nuget 包?
作为解决方法,您可能需要查看示例的以下分支(其中仍然包含现在已移至 ASP.NET Core AADIntegration 的代码):https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master
运行 进入同样的问题。安装 these 个模块后,编译成功。
我正在尝试按照本教程在 .NET 核心 Web 应用程序中进行 Azure AD 身份验证:
我得到这个错误:
The type or namespace name 'OpenIdConnectOptions' could not be found (are you missing a using directive or an assembly reference?)
我正在使用 Linux 并没有问题生成和构建基本模板,问题似乎出现在教程说添加此行的地方:
services.Configure<OpenIdConnectOptions>(AzureADDefaults.OpenIdScheme, options =>
{
options.Authority = options.Authority + "/v2.0/";
options.TokenValidationParameters.ValidateIssuer = false;
});
我试过添加包(半随机)例如:
Microsoft.IdentityModel.Protocols.OpenIdConnect
Microsoft.Owin.Security.OpenIdConnect
无济于事,因为错误仍然存在,我遇到了新问题,例如:
Error: Package 'Microsoft.Owin 4.0.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.
我不确定我是否缺少身份验证的一些基础知识和 linux 上的 运行 .net 核心,我是新手,只是想通过一个工作演示来启动确实做了一些事情:)
我还没有检查 linux,但是您缺少的 nuget 包应该是由以下项目的 ASP.NET Core 生成的:https://github.com/aspnet/AADIntegration。您是否尝试更新 ASP.NET Core 的最新 nuget 包?
作为解决方法,您可能需要查看示例的以下分支(其中仍然包含现在已移至 ASP.NET Core AADIntegration 的代码):https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master
运行 进入同样的问题。安装 these 个模块后,编译成功。