【问题标题】:Firefox doesn't show authentication prompt with Windows AuthenticationFirefox 不显示使用 Windows 身份验证的身份验证提示
【发布时间】:2014-03-24 12:11:02
【问题描述】:

我正在为一个组织构建一个 Intranet ASP.NET Web 应用程序,并希望使用 Windows 身份验证对用户进行身份验证。我有两个 WCF WebHttpBinding 绑定的自托管服务。两者都使用带有 RESTHttpBinding 配置的 webHttpBinding。

<webHttpBinding>
    <binding name="RESTHttpBinding">
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Windows"/>
      </security>
    </binding>
  </webHttpBinding>

我的服务在 Chrome、Opera 和 IE 上正常运行(提示进行身份验证)(在后一种情况下 - 仅当我将安全设置中的用户身份验证中的登录设置为“提示输入用户名和密码”时)。但在 Firefox 中,我可以使用 this 方法来允许自动身份验证,或者得到与 this post 中描述的完全相同的结果:只是 401 Unauthorized 和空白页。

我花了几个小时在谷歌上搜索并尝试不同的选择。我找不到让 Firefox 显示提示的方法。

【问题讨论】:

    标签: asp.net wcf firefox authentication windows-authentication


    【解决方案1】:

    我检查了它在使用 Windows 身份验证的 Sharepoint 中是如何发生的,在 Firefox 中出现了提示,结果证明 Sharepoint 中的服务器响应带有标题

    WWW-Authenticate: NTLM
    

    而在我的情况下,我收到了带有

    的 401 响应
    WWW-Authenticate: Negotiate
    

    所以我更改了我的 app.config 文件:

      <webHttpBinding>
        <binding name="RESTHttpBinding">
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="NTLM"/>
          </security>
        </binding>
      </webHttpBinding>
    

    现在提示出现了。

    这仍然不是我完全满意的解决方案:据说 NTLM 与 Windows 身份验证相比正在降级。

    【讨论】:

      【解决方案2】:

      我找到了这个答案elsewhere

      1. 打开 IIS 并选择遇到 401 的网站
      2. 打开“IIS”类别中的“Authentication”属性
      3. 点击“Windows Authentication”项,然后点击“Providers”
      4. 将 NTLM 移到协商上方

      如果这不起作用,也许您使用的是 Mac。我发现如果连接不受 SSL 保护,Mac Firefox 甚至不允许输入您的凭据。

      【讨论】:

      • 哦,我没有指定它:我的服务不是 IIS 托管的。它是自托管的。
      • 啊,我现在看到您说“两个 WCF WebHttpBinding 绑定的自托管服务”。不过,如果其他人使用 IIS 到达这里,我会留下我的答案。
      • 是的,我认为这可能对某人有帮助
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-14
      • 2017-02-08
      • 2010-10-05
      • 2013-10-30
      • 1970-01-01
      相关资源
      最近更新 更多