.htaccess 在 chrome 中需要密码,但在其他浏览器中不需要?

.htaccess 在 chrome 中需要密码,但在其他浏览器中不需要?

我们的网站上有 .htaccesshttp://subdomain.site.com/

AuthType Kerberos
AuthName "Internet ID"

require valid-user

order deny,allow
deny from all
allow from all

在网站的子目录中,http://subdomain.site.com/subdirectory/我们有一个.htaccess:

AuthType none
Satisfy any 

原因是在这个子目录/上我们有一个不同的身份验证机制,并且不想使用 kerberos 作为身份验证。但问题是在 chrome 中 .htaccess 身份验证仍然会弹出,但 Firefox、Opera、IE 在加载页面之前不会提示进行此身份验证。

我无法理解服务器端配置如何根据浏览器的不同以不同的方式呈现给最终用户?我的子目录 .htaccess 中是否缺少某些内容?

答案1

我刚刚重现了这个问题。Chrome 正在请求 /favicon.ico 并收到 HTTP/1.1 401 需要授权。其他浏览器会忽略它。Chrome 会显示一个身份验证对话框。请尝试将其添加到您网站上的 .htaccess 中http://subdomain.site.com/

<Files "favicon.ico">
    AuthType none
    Satisfy any
</Files>

这是错误...http://code.google.com/p/chromium/issues/detail?id=12876...很糟糕。

答案2

使用 chrome 时,您必须在命令行上向其传递参数才能使 www-negotiate 正常工作。具体来说,您必须将启用 kerberos 的 Web 服务器的主机名 (FQDN) 列入白名单。从http://www.chromium.org/developers/design-documents/http-authentication

google-chrome --auth-server-whitelist="*example.com,*foobar.com,*baz"

如果您只想强制使用 gssapi 而不使用基本身份验证:

google-chrome --auth-schemes="negotiate"

请参阅上面的链接了解更多信息。

答案3

猜测一下,最可能的原因是 Chrome 不支持 Kerberos,或者不像其他三种浏览器那样支持它。可能所有用户都经过身份验证,服务器仍然需要身份验证(不是您想象的那样) - 但支持 Kerberos 的浏览器会透明地执行此操作。

我会说将 apache 设置为在访问日志中记录用户名,并查看是否允许通过用户名进入其他浏览器的点击......然后从那里开始。

相关内容