2012-01-13 12 views
2

我需要爲web界面asp.net做windows身份驗證。
我已經設置配置認證模式等於Windows。asp.net web界面的c#windows身份驗證

對於Windows身份驗證,我們需要設置僅此:
- <authentication mode="Windows" />

和IIS我們需要:
-remove匿名訪問
-check集成Windows身份驗證。

我們是否需要對Windows身份驗證進行其他操作?
如何獲取在c#中驗證的用戶名?

感謝

回答

4

沒有,沒有別的要求Windows身份驗證(假設你只需要身份驗證,而不是模仿)在asp.net應用程序。 您現在可以從

獲得用戶身份
(WindowsIdentity)HttpContext.Current.User.Identity;