Asp.Net 核心 HTTP.SYS Windows 身份验证回退到 NTLM 而不是 Kerberos

Asp.Net Core HTTP.SYS Windows authentication falls back to NTLM instead of Kerberos

我创建了一个 ASP .NET core 2.2 应用程序,它使用 HTTP.SYS 和 Windows 身份验证:

.UseHttpSys(options =>
{
    options.AllowSynchronousIO = true;
    options.Authentication.Schemes = Microsoft.AspNetCore.Server.HttpSys.AuthenticationSchemes.Negotiate | Microsoft.AspNetCore.Server.HttpSys.AuthenticationSchemes.Kerberos;
    options.Authentication.AllowAnonymous = false;
    options.MaxConnections = null;
    options.MaxRequestBodySize = 30000000;
    options.UrlPrefixes.Add("http://192.168.1.1:5000");
});

and 运行s 在我的电脑上(使用我当前的域用户,也是管理员)。如果我 运行 Kerberos Authentication Tester,它会告诉我它正在使用 NTLM(这是 Kerberos 不可用时协商的备份计划)。我的应用程序显示身份验证是协商的。

如果我 运行 Fiddler 并打开自动身份验证,然后重复测试,则 Kerberos 身份验证测试器显示 None 作为身份验证(预期!),而我的应用程序显示身份验证是 Kerberos。

为什么 Kerberos 身份验证测试器总是退回到 NTLM?

PC 是 运行ning Windows 10 1803.

谢谢,

终于找到原因了。我需要在 Kerberos Authentication Tester 中指定服务器的完全限定域名而不是机器 IP。它神奇地起作用了。我得到的令牌是 SPNEGO,而不是 Kerberos,但我的理解是 SPNEGO 令牌包装了 Kerberos 或 NTLM。看到这个 answer on SO