我有一个RoR应用程序已经运行良好,但是在最近的一次部署之后,在浏览到根URL时,办公室中的所有IE用户都被提供了IE用户名和密码popup对话框。 该对话框标题为“连接到”并具有文本“Web密码服务器需要用户名和密码”。
问题的特点:
想法? 这会导致什么?
其他有关configuration的信息:
唉唉!
所以这实际上是一个源于“access_denied”方法的restful_authentication问题:
def access_denied respond_to do |format| format.html do store_location redirect_to new_session_path end format.any do request_http_basic_authentication 'Web Password' end end end
format.any行被IE执行(可能是IE中的一个bug),但是解决方法是改变“format.any do”这一行:
format.any(:js, :xml) do
这将仍然允许您的Web服务与基本身份validation连接,同时防止IE显示此对话框。
资料来源: http : //rails_security.lighthouseapp.com/projects/15332/tickets/5-using-http-basic-authentication-with-ie-not-working