簡體   English   中英

IIS 7.5 Windows集成身份驗證混亂

[英]IIS 7.5 Windows integrated authentication confusion

在VS2010中進行調試時執行以下代碼時,如何顯示NTLM和Kerberos AuthenticationType:

IIdentity WinId = HttpContext.Current.User.Identity;
WindowsIdentity currentIdentity = WindowsIdentity.GetCurrent();

lblUserName.Text ="User NAme: " + WinId.Name;
lblIsAuthenticated.Text = "Is Authenticated: " + WinId.IsAuthenticated.ToString();
lbluthentiationType.Text = "Authetication type: " + WinId.AuthenticationType;
lblAuthenticationType2.Text = "Authentication Type: " + currentIdentity.AuthenticationType; 

當我查看本地服務器時,它在lblAuthenticatinType和lblAuthenticatinType2上均顯示“協商”

通過IP(172.0.0.10:1111)訪問Web服務器時只能看到經過身份驗證的用戶,而通過servername:1111和servername.domain.com:1111進行訪問時,我只能看到401.1。

我不知道在哪里咬。 我已經在web.config中啟用了身份驗證,如下所示

<authentication mode="Windows">
    <!--<identity impersonate="true" userName="<domain>\<UserName>" password="<password>"/>-->
</authentication>
<authorization>       
    <!--<allow users="domain\user.name" /><allow roles="domain\Users" />-->
    <allow users="?" />    
</authorization> 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM