1
我一直在追逐這個問題一段時間,現在我無法瞭解它的底部。我讀過這裏的其他解決方案(https://identityserver4.readthedocs.io和https://github.com/IdentityServer/IdentityServer4.Quickstart.UI),但它仍然無法正常工作,所以我試圖將其降低到絕對的基本水平。這不是我所面臨的實際問題,而是產生了非常相同的結果。即我無法使Windows身份驗證正常工作。IdentityServer4&Windows身份驗證
- 我克隆https://github.com/IdentityServer/IdentityServer4.Samples
- 我修改
Quickstarts/7_JavaScriptClient/src/QuickstartIdentityServer/Quickstart/Account/AccountController.cs
使WindowsAuthenticationEnabled
是true
- 我然後轉到http://localhost:5000/account/login並嘗試使用Windows外部供應商,我得到401
唯一的區別這個簡單的例子,以及我在我的實際系統上看到的是,我在我的真實網站上獲得憑據的挑戰。
調試代碼我從來沒有看到if(HttpContext.User is WindowsPrincipal)
成功,因爲它始終是ClaimsPrincipal
。
有人可以向我解釋我做錯了什麼嗎?
是的,Windows身份驗證在IIS上啓用。我已經用UseIISIntegration運行Kestrel,所以我猜IIS是作爲這個的反向代理。 –
IIS或IIS Express?爲網站或服務器啓用?我問,因爲HttpContext.User是WindowsPrincipal工作正常,所以這很可能是一個環境問題。 –
哇...我爲網站和應用程序啓用了Windows身份驗證,但是當我爲服務器啓用它時,它全部進入生活。謝謝。 –