【问题标题】:How can I make sure AuthName works in all browsers?如何确保 AuthName 在所有浏览器中都有效?
【发布时间】:2016-03-17 15:13:51
【问题描述】:

下面的代码似乎在 Firefox、IE、Safari 中显示文本“HELLO WORLD”很好,但在 Chrome 中却没有。

<Files wp-login.php>
AuthType basic
AuthName "HELLO WORLD"
AuthBasicProvider file
AuthUserFile /home/.htpasswd
Require valid-user
</Files>
ErrorDocument 401 "Authentication required"

如何确保 AuthName 在所有浏览器中都有效?

【问题讨论】:

    标签: apache .htaccess google-chrome .htpasswd


    【解决方案1】:

    AuthName 指令在相应的标头中设置realm 参数,类似于:

    WWW-Authenticate: Basic realm="HELLO WORLD"
    

    我发现了一张 2015 年 10 月的 Chromium 票证,该票证报告了与 HTTP 身份验证相关的中间人攻击:Issue 544244 - HTTP basic auth credentials prompt should make the origin stand out more。在讨论中,有人指出领域中的文本不可信,可用于网络钓鱼攻击,以诱骗用户向第三方泄露密码。我不是安全专家,但我知道代理可以注入标头——而且通常会——因此是这个问题。

    显然,因此该领域已从身份验证对话框中删除,并且最终将更改移植到 Chrome。您可以查看Do not show untrustworthy strings in the basic auth dialog 代码审查了解更多详情。

    【讨论】:

    • 我今天在修改 Apache 配置时注意到了。不幸的是,即使使用加密连接也没有显示
    • 希望我可以在浏览器设置中覆盖它:/
    猜你喜欢
    • 2011-05-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-20
    • 1970-01-01
    • 1970-01-01
    • 2012-10-15
    相关资源
    最近更新 更多