如何启用 Windows 身份验证?

时间:2021-01-04 08:42:43

标签: .net asp.net-core

我在 IIS 中托管了 ASP.NET Core MVC。我已经在 IIS 中启用了 Windows 身份验证。

我看过这个:https://docs.microsoft.com/en-us/aspnet/core/security/authentication/windowsauth?view=aspnetcore-3.1&tabs=visual-studio

在我的 Startup 中,我已经有了这个:

services.AddAuthentication(IISDefaults.AuthenticationScheme);

在我的登录按钮中,我调用:

Challenge("Windows")

但是我得到了

<块引用>

InvalidOperationError:未注册身份验证处理程序。你忘记调用 AddAuthentication().AddSomeAuthHandler 了吗?

似乎我需要一个用于 Windows 的身份验证处理程序,我猜是这样的:

services.AddAuthentication()
        .AddOpenIdConnect("oidc", o => { // Lots of options here});

但我找不到任何适用于 Windows 身份验证处理程序的 Nuget 包。我错过了什么?

0 个答案:

没有答案
相关问题