Basic Authentication fails with curl using restful_authentication plugin

Rails 1.2.3 Ruby 1.8.4 url 7.15.5

I have a simple app that uses the restful_authentication plugin. Authentication works great from the browser but when I try to test things via curl I get "Couldn't authenticate you".

Here is the curl command I'm using:

curl -v -H 'Accept: application/xml' -H 'Content-Type: application/ xml' -b -u username:password -d '<request></request>' http://theurl.com

I've also tried this:

curl -v -H 'Accept: application/xml' -H 'Content-Type: application/ xml' -d '<request></request>' http://username:password@theurl.com

The curl command will works fine if I don't pass the -d switch.

Thanks in advance for the help.

This is because RESTful Authentication is not an HTTP Authentication system.

line 103 of authenticated_system.rb says to me that it is…

Called from #current_user. Now, attempt to login by basic authentication information.

def login_from_basic_auth
  username, passwd = get_auth_data

  self.current_user = User.authenticate(username, passwd) if username && passwd
end

Also, the project log states that this has been added:

http://projects.wh.techno-weenie.net/browser/r2943/plugins/restful_authentication/generators/authenticated/templates

The issue only happens in production (Linux/Apache/FCGI). It works fine in development (Win XP/Webrick). I'm still investigating and will post anything new here.

It looks like it is an issue with my host. The response.env is missing the HTTP_AUTHENTICATION header. I'm not really sure if this is a problem with just my host or all Apache/FastCGI set ups.