简体   繁体   English

Windows身份验证 - Chrome与Internet Explorer

[英]Windows Authentication - Chrome vs Internet Explorer

I have an application deployed to IIS 6.1. 我有一个部署到IIS 6.1的应用程序。 When I enter my ASP app in Chrome, popup windows appear and I enter username and password to log into my app successfully. 当我在Chrome中输入我的ASP应用程序时,会出现弹出窗口,我输入用户名和密码以成功登录我的应用程序。 But when I login via Internet Explorer, I can't pass authentication. 但是当我通过Internet Explorer登录时,我无法通过身份验证。 What could cause such behavior? 什么可能导致这种行为?

Since the article linked by Xhalent shows a 404 now, I dug through Archive.org and found a version back from 2009 . 由于Xhalent链接的文章现在显示404,我通过Archive.org挖掘并从2009年发现了一个版本

I don't know how long this Archive.org version stays stable, so I'm quoting the article here: 我不知道这个Archive.org版本保持稳定多久,所以我在这里引用这篇文章:


Enabling NTLM Authentication in Firefox and Internet Explorer 在Firefox和Internet Explorer中启用NTLM身份验证

This tip is useful for organizations who are standardized on Microsoft technologies (Active Directory, IIS, and ASP.NET) and need to provide minimal-intrusion authentication for their internal web applications. 此提示对于标准化Microsoft技术(Active Directory,IIS和ASP.NET)并需要为其内部Web应用程序提供最小入侵身份验证的组织非常有用。 I was stumped for a long time on this one. 我在这个问题上被困了很长时间。 Here's the scenario: 这是场景:

All of my ASP.NET applications - at this point - are internal to the organization that I work for. 我所有的ASP.NET应用程序 - 此时 - 都是我工作的组织的内部应用程序。 We are a strictly Microsoft shop, and, because of this, I always leverage Active Directory in everyway possible. 我们是一家严格的微软商店,因此,我总是尽可能地利用Active Directory。 Well, this is great from my (a developer's) perspective, as it means that I don't have to build and maintain a login system. 嗯,从我(开发人员)的角度来看,这很好,因为这意味着我不必构建和维护登录系统。 However, I recently started getting feedback from users across the country saying that they were being challenged with a login screen when they accessed the applications. 但是,我最近开始收到全国各地用户的反馈,说他们在访问应用程序时遇到了登录屏幕的挑战。 This was okay, as they could still get in using their Active Directory accounts, but sometimes they had to append the domain to the beginning of their name, and it all became kind of a pain. 这没关系,因为他们仍然可以使用他们的Active Directory帐户,但有时他们必须将域名附加到他们的名字的开头,这一切都变得有点痛苦。

We are a diverse organization, in that we have many different network configurations. 我们是一个多元化的组织,因为我们有许多不同的网络配置。 Some of our users are on high-quality T1 connections, while others are still on intermittent - at best - connections. 我们的一些用户使用高质量的T1连接,而其他用户仍然处于断断续续的连接状态。 Because of this disparity, I initially blamed the login problem on different network configurations (firewalls, distance to domain controller, etc.), but after doing a bit more research I found that the problem was actually browser related. 由于这种差异,我最初归咎于不同网络配置(防火墙,到域控制器的距离等)的登录问题,但经过一些研究后我发现问题实际上与浏览器有关。

By the way, the Internet Explorer setting can also be implemented via group policy (thanks to Chris, James, and Marilyn for helping me figure this one out). 顺便说一句,Internet Explorer设置也可以通过组策略实现(感谢Chris,James和Marilyn帮助我解决这个问题)。 Look in the registry at: 在注册表中查看:

HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Domains HKEY_CURRENT_USER \\ Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Internet Settings \\ ZoneMap \\ Domains

So, here are the steps you need to take to enable NTLM pass-through authentication in Internet Explorer (6 & 7) and Firefox (2): 因此,以下是在Internet Explorer(6和7)和Firefox(2)中启用NTLM传递身份验证所需的步骤:

Internet Explorer IE浏览器

Note: These instructions apply to both IE 6 and IE 7, although there may be slight differences in the screenshots below. 注意:这些说明适用于IE 6和IE 7,但下面的屏幕截图可能略有不同。

Note2: For some reason, some of the entries that are added to the Local intranet zone seem to be persistent. 注意2:由于某种原因,添加到本地Intranet区域的某些条目似乎是持久的。 You'll delete them in the interface, close all the windows out, come back and they'll reappear. 您将在界面中删除它们,关闭所有窗口,返回它们将重新出现。 The only way I found to permanently get rid of them was to manually delete the registry entry located at the location cited just above this section. 我发现永久摆脱它们的唯一方法是手动删除位于本节上方引用位置的注册表项。

  1. In Internet Explorer, click on Tools and select Internet Options . 在Internet Explorer中,单击“ 工具”,然后选择“ Internet选项”

  2. Next, click on the Security tab at the top of the Internet Options window. 接下来,单击“ Internet选项”窗口顶部的“ 安全”选项卡。

  3. Once the contents of the Security tab are displayed, highlight Local intranet and click on the Sites button 显示“ 安全”选项卡的内容后,突出显示“ 本地Intranet” ,然后单击“ 站点”按钮

  4. In the Local intranet dialog that pops up, make sure that the last three boxes are checked and click on the Advanced button. 在弹出的“ 本地Intranet”对话框中,确保选中最后三个框,然后单击“ 高级”按钮。

  5. In the next dialog, type the following into the Add this website to the zone text box: " http://www.example.org " (without the quotes) and click on the Add button. 在下一个对话框中,在“ 将此网站添加到区域”文本框中键入以下内容:“ http://www.example.org ”(不带引号),然后单击“ 添加”按钮。

Note: If you'd like to enable Active Directory pass-through authentication for all the sites on a domain, type the following into the Add this website to the zone text box: "http://*.example.org" (without the quotes). 注意:如果您要为域中的所有站点启用Active Directory传递身份验证,请在“ 将此网站添加到区域”文本框中键入以下内容:“http://*.example.org”(不带报价)。

Mozilla Firefox 火狐浏览器

Note: These instructions have been tested on Firefox 2.0.0.1. 注意:这些说明已在Firefox 2.0.0.1上测试过。

  1. In the address bar of your Firefox browser window, type the following: "about:config" (without the quotes) and press Enter. 在Firefox浏览器窗口的地址栏中,键入以下内容:“about:config”(不带引号),然后按Enter键。

  2. In the configuration page that displays, scroll down to the following entry: "network.automatic-ntlm-auth.trusted-uris" and double-click on it. 在显示的配置页面中,向下滚动到以下条目:“network.automatic-ntlm-auth.trusted-uris”并双击它。

  3. In the Enter string value that pops up, type " http://www.example.org " (without the quotes) into the text box and click OK . 在弹出的输入字符串值中 ,在文本框中键入“ http://www.example.org ”(不带引号),然后单击“ 确定”

Note: If you'd like to enable Active Directory pass-through authentication for all of the sites on a domain, type the following into the textbox: ".example.org_" (without the quotes). 注意:如果您要为域中的所有站点启用Active Directory传递身份验证,请在文本框中键入以下内容:“。example_name_”(不带引号)。

I'm not entirely sure exactly what behaviour you're after (you state in a comment that you've enabled anonymous access, however you appear happy with Chrome presenting a challenge response dialog to the user). 我并不完全确定您所追求的行为(您在评论中说明您已启用匿名访问,但您似乎对Chrome向用户提供质询响应对话框表示满意)。

The issue is most likely that IE is passing your desktop credentials to the site, but they are being rejected, while Firefox/Chrome are not as doing this, hence the challenge response dialogs. 问题很可能是IE 正在将您的桌面凭据传递给该网站,但它们被拒绝,而Firefox / Chrome则没有这样做,因此挑战响应对话框。

The options are: 选项是:

  1. Move the site out of the "Local Intranet" zone into (say) the "Trusted Sites" zone: 将站点移出“本地Intranet”区域(例如)“可信站点”区域:
    1. (For IE8 and below) Tools | (对于IE8及以下版本)工具| Internet Options (IE9) Click on the Cog Icon | Internet选项(IE9)单击Cog图标| Internet Options 互联网选项
    2. Switch to "Security" tab. 切换到“安全”选项卡。
    3. Click on "Trusted sites" and press the "Sites" button. 单击“可信站点”,然后按“站点”按钮。
    4. Add the Domain to the list - you may need to clear the "Require server verification (https:) for all sites in this zone" and OK. 将域添加到列表中 - 您可能需要清除“对该区域中的所有站点要求服务器验证(https :)”并单击“确定”。
    5. Back on the Security tab, click the "Custom level..." button, scroll to the end of the Settings list, and make sure that the User Authentication | 返回Security选项卡,单击“Custom level ...”按钮,滚动到Settings列表的末尾,并确保User Authentication | Logon is set to "Automatic Logon only in Intranet Zone". 登录设置为“仅在Intranet区域中自动登录”。
  2. Change all Intranet sites to prompt for credentials (I'd advise against this however, because it will cause you pain): 更改所有Intranet站点以提示凭据(但我建议不要这样做,因为它会让您感到痛苦):
    1. Open the Internet Options dialog as per steps 1.1 and 1.2 above. 按照上面的步骤1.1和1.2打开“Internet选项”对话框。
    2. Switch to the "Security" tab, and select "Local intranet". 切换到“安全”选项卡,然后选择“本地Intranet”。
    3. Click on the "Custom level..." button, scroll to the end of the Settings list, and make sure that the User Authentication | 单击“自定义级别...”按钮,滚动到“设置”列表的末尾,并确保“用户身份验证”| Logon is set to "Prompt for user name and password". 登录设置为“提示输入用户名和密码”。

You might need to ensure that the deployed site in the Local Intranet zone in IE. 您可能需要确保在IE中的本地Intranet区域中部署的站点。 The following post discusses how to configure NTLM for IE and Firefox. 以下文章讨论了如何为IE和Firefox配置NTLM。

Whether you have anonymous access enabled (which you don't appear to), whether you have integrated security enabled, and which type of authentication you have selected for integrated security. 是否启用了匿名访问(您似乎没有),是否已启用集成安全性,以及您为集成安全性选择了哪种类型的身份验证。 Whether you have integrated security enabled in IE. 是否在IE中启用了集成安全性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM