[英]Windows Authentication not getting enabled in IIS 7.5
I am just starting to learn ASP.NET. 我刚刚开始学习ASP.NET。 I opened a default ASP.NET application and changed the web.config file to enable Windows authentication.
我打开了一个默认的ASP.NET应用程序并更改了web.config文件以启用Windows身份验证。
<authentication mode="Windows">
</authentication>
When I run from VS using the asp.net development server, it is able to detect my windows login and display it. 当我使用asp.net开发服务器从VS运行时,它能够检测我的Windows登录并显示它。 I tried publishing it to the IIS server 7.5 in the same PC and ran from there.
我尝试将它发布到同一台PC中的IIS服务器7.5并从那里运行。 Now my windows login is not getting detected.
现在我的Windows登录没有被检测到。 I have enabled the Windows Authentication from the Authentication feature in IIS.
我已从IIS中的身份验证功能启用了Windows身份验证。 What else I might be missing in this case?
在这种情况下我还可能缺少什么?
Thanks.. 谢谢..
Try disabling Anonymous Authentication in IIS 7.5 for that web-site. 尝试在IIS 7.5中为该网站禁用匿名身份验证。
Only "Windows Authentication" should be enabled for your purposes. 只应为您的目的启用“Windows身份验证”。
The reason this works is that a browser will perform the first request anonymously. 这样做的原因是浏览器将匿名执行第一个请求。 If anonymous authentication is enabled this request will succeed, and so the web-server will have no idea who you are.
如果启用了匿名身份验证,则此请求将成功,因此Web服务器将不知道您是谁。
If you use a tool like Fiddler to examine the network traffic between you and the server, you will notice that you actually get 3 requests if Windows Authentication is the only configured method. 如果您使用像Fiddler这样的工具来检查您和服务器之间的网络流量,您会注意到如果Windows身份验证是唯一配置的方法,您实际上会收到3个请求。 The requests get the following responses:
请求得到以下响应:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.