我可以强迫阿帕奇成不包括WWW身份验证头失败的HTTP基本认证? [英] Can I coerce Apache into not including a WWW-Authenticate header for failed HTTP Basic Auth?

查看:167
本文介绍了我可以强迫阿帕奇成不包括WWW身份验证头失败的HTTP基本认证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用HTTP基本身份验证使用AJAX请求。 Firefox 3的是一个悲观主义者,总是显示失败凭据的对话框 - 尽管我不希望之一。

<一个href=\"http://stackoverflow.com/questions/86105/how-can-i-su$p$pss-the-browsers-authentication-dialog\">This问题总结了一些浏览器和JS问题;你会发现它是在客户端解决。幸运的是,我至少有一些自由更改服务器 - 我可以修改我的的.htaccess 文件

基本上,只要火狐看到WWW身份验证标头,它会尝试再次进行身份验证。 我可以燮preSS该头的只有的通过修改我的的.htaccess 文件?如果这样的AJAX请求,怎么样?我可以在必要时我XHR请求传递一个自定义标题。

下面是它看起来像现在:

  AuthType选项基本
的AuthUserFile /www/private/.htpasswd
AuthName指令私人收藏
需要有效的用户


解决方案

我面对我通过书面的NodeJS中的代理解决了类似的问题。
或许,这可以帮助你:<一href=\"http://stackoverflow.com/questions/5448975/write-proxy-wrapper-class-for-own-service-in-jersey\">Write代理/包装类在泽西自己的服务

I'm using HTTP Basic Authentication with AJAX requests. Firefox 3 is a whiner and always displays a dialog box for failed credentials -- even though I don't want one.

This question summarizes some of the browser and JS issues; you'll notice it's unresolved on the client side. Luckily, I have at least some freedom to change the server -- I can modify my .htaccess file.

Basically, whenever Firefox sees the WWW-Authenticate header, it tries to authenticate again. Can I suppress that header only for AJAX requests by modifying my .htaccess file? If so, how? I can pass a custom header in my XHR request if necessary.

Here's what it looks like currently:

AuthType Basic
AuthUserFile /www/private/.htpasswd
AuthName "Private Collection"
require valid-user

解决方案

I faced a similar problem that I solved through a proxy written in nodejs. Perhaps this can help you: Write proxy/wrapper class for own service in jersey

这篇关于我可以强迫阿帕奇成不包括WWW身份验证头失败的HTTP基本认证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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