Windows身份验证不工作的本地IIS 7.5。 401.1错误 [英] Windows Authentication not working on local IIS 7.5. Error 401.1

查看:368
本文介绍了Windows身份验证不工作的本地IIS 7.5。 401.1错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近有一个讨厌的问题,让Windows身份验证在IIS 7.5(Windows 7的专业版)的本地实例工作的ASP.net 4.0站点。我跟着的基本步骤。

I recently had a nasty issue getting Windows Authentication to work on a local instance of IIS 7.5 (Windows 7 Pro) to an ASP.net 4.0 site. I followed the basic steps.

IIS身份验证


  • 禁用匿名身份验证

  • 启用Windows身份验证

编辑的web.config

Edit web.config

<authentication mode="Windows" />

这确实使Windows身份验证,但每次尝试登录的一个很好的工作被拒绝,并最终返回401.1错误。这是问题开始的地方。似乎有许多原因被网络,包括在这里对堆栈溢出周围有据可查的。

This did a nice job of enabling Windows Authentication but every attempt to login was rejected and ultimately returned a 401.1 error. This is where the problem started. There appear to be many reasons for this that are well documented around the web including here on Stack Overflow.

我已经试过:


  • 编辑IIS身份验证高级设置对Windows身份验证禁用扩展保护和内核模式身份验证

  • 编辑IIS身份验证供应商移动上述NTLM协商。

  • 编辑IIS .NET授权规则明确地允许用户(以及各种其他组合)。

  • 各种IIS的命令行脚本和调整。

  • 在web.config文件
  • 各种配置的调整。

  • 即使是一些文件系统权限调整。

但都无济于事,可怕的401.1依然存在。

But all to no avail, the dreaded 401.1 remained.

这还真是看不到树木,不见森林的情况。我设法找到解决方案的无(称之为如果你将一个不好的搜索参数的情况下)为我工作,所以我认为它值得张贴这个问题,希望提供一个清晰的答案更容易找到任何人遭受同样的问题

This really is a case of "can't see the wood for the trees". None of the solutions I managed to find (call it a case of bad search parameters if you will) worked for me so I thought it worth posting this question to, hopefully, provide a clear answer that's easier to find for anyone suffering the same issue.

推荐答案

这里的问题是,Windows(Windows XP SP2中的Windows Server 2003 SP1及以上)的现代版包括旨在帮助$环回检查安全功能您的计算机页上$ pvent反射攻击。因此,身份验证失败,如果您使用不匹配本地计算机名的FQDN或自定义主机头。

The issue here is that modern versions of Windows (Windows XP SP2, Windows Server 2003 SP1 and up) include a loopback check security feature that is designed to help prevent reflection attacks on your computer. Therefore, authentication fails if the FQDN or the custom host header that you use does not match the local computer name.

这可以通过明确指定主机名或禁用环回检查得到解决。显然,前者为更多的控制方法。

This can be resolved by either explicitly specifying host names or by disabling the loopback check. Obviously the former being the more controlled approach.


  1. 将DisableStrictNameChecking注册表项1.请参阅: 281308 (注:我没必要做到这一点)

  2. 在注册表编辑器,找到并单击下面的注册表项:
    HKEY_LOCAL_MACHINE \\系统\\ CurrentControlSet \\控制\\ LSA \\ MSV1_0

  3. 右键单击MSV1_0,指向新建,然后单击多字符串值。

  4. 键入BackConnectionHostNames,然后preSS ENTER键。

  5. 右键单击BackConnectionHostNames,然后单击修改。

  6. 在数值数据框中,输入主机名或在本地计算机上的站点主机名,然后单击确定。

  7. 退出注册表编辑器,然后重新启动IISAdmin服务。

中如何做到这全部细节可以在MSDN上找到: 896861

Full details of how do to this can be found on MSDN: 896861

希望这可以帮助别人了。如果您有任何建议替代或改进,请补充。

Hope this helps someone out. If you have any alternate suggestions or improvements please add.

这篇关于Windows身份验证不工作的本地IIS 7.5。 401.1错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆