我一直在追逐这个问题已经有一段时间了,我无法深究这个问题。我已经在这里阅读了其他解决方案(https://identityserver4.readthedocs.io和https://github.com/IdentityServer/IdentityServer4.Quickstart.UI)并且它仍然无效,所以我尝试将其降低到绝对基础。这不是我面临的实际问题,但会产生相同的结果。即我无法使用Windows身份验证。
Quickstarts/7_JavaScriptClient/src/QuickstartIdentityServer/Quickstart/Account/AccountController.cs
,以便WindowsAuthenticationEnabled
为true
这里这个简单示例的唯一区别,以及我在实际系统中看到的是我在真实网站上的凭据受到质疑。
调试代码我从未见过if(HttpContext.User is WindowsPrincipal)
成功,因为它始终是ClaimsPrincipal
。
有人可以向我解释我做错了吗?
答案 0 :(得分:2)
您的IIS站点上是否启用了Windows身份验证?需要启用此功能才能分配WindowsPrincipal。请注意,Windows身份验证仅在IIS或IIS Express后运行时才有效。