简体   繁体   English

IIS 7.5 Windows集成身份验证混乱

[英]IIS 7.5 Windows integrated authentication confusion

How is this possible to display NTLM and Kerberos AuthenticationType when executing this code when debugging in VS2010: 在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; 

When I look in local server it shows Negotiate on both lblAuthenticatinType and lblAuthenticatinType2 当我查看本地服务器时,它在lblAuthenticatinType和lblAuthenticatinType2上均显示“协商”

also

I am only able to see authenticated users when accessing the web server by IP (172.0.0.10:1111) and 401.1 when accessig by servername:1111 and servername.domain.com:1111 通过IP(172.0.0.10:1111)访问Web服务器时只能看到经过身份验证的用户,而通过servername:1111和servername.domain.com:1111进行访问时,我只能看到401.1。

I don't know where to bit this. 我不知道在哪里咬。 I have enabled authentication in web.config as follows 我已经在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