How is this possible to display NTLM and Kerberos AuthenticationType when executing this code when debugging in VS2010:
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
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
I don't know where to bit this. I have enabled authentication in web.config as follows
<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>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.