# Restful\_authentication plugin and http\_basic problem

**URL:** <https://www.ruby-forum.com/t/restful-authentication-plugin-and-http-basic-problem/145470>\
**Category:** Rails\
**Created:** [August 10, 2008, 10:28am UTC](https://www.ruby-forum.com/t/restful-authentication-plugin-and-http-basic-problem/145470 "2008-08-10T10:28:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcarlson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@mcarlson](https://www.ruby-forum.com/u/mcarlson)\
**Post date:** [August 10, 2008, 10:28am UTC](https://www.ruby-forum.com/t/restful-authentication-plugin-and-http-basic-problem/145470/1 "2008-08-10T10:28:34Z")

</div>

So I installed the most recent restful\_authentication plugin from  
github and ran into a frustrating problem… on Internet Explorer 6  
and 7 I received a security dialog box rather than seeing the login  
view. When I clicked logout I received the same dialog.

I came across some posts on the web that led me to remove the  
following line (73: authenticated\_system.rb)

request\_http\_basic\_authentication ‘Web Password’

That worked for the login view, but logout still showed the dialog. So  
I removed the format block around it:

format.any do  
request\_http\_basic\_authentication ‘Web Password’  
end

Now everything is working! 🙂

However, I would like to understand what is happening here and WHY  
this worked. Anyone have any thoughts?

---

<div class="post-metadata">

**Author:** ![mcarlson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@mcarlson](https://www.ruby-forum.com/u/mcarlson)\
**Post date:** [August 10, 2008, 9:52pm UTC](https://www.ruby-forum.com/t/restful-authentication-plugin-and-http-basic-problem/145470/2 "2008-08-10T21:52:19Z")

</div>

On Aug 10, 1:27 am, Matthew C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> That worked for the login view, but logout still showed the dialog. So  
> I removed the format block around it:
> 
> format.any do  
> request\_http\_basic\_authentication ‘Web Password’  
> end
> 
> Now everything is working! 🙂

Sometimes IE sends back a blank HTTP Accept header, and it triggers  
the ‘format.any’ block as opposed to ‘format.html’. Try changing it  
to ‘format.any(:xml, :json)’ instead. That way it’s only triggered  
for those two formats.
