Hardbap
2007-Sep-07 15:14 UTC
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-uj0Z+6/7SLHQT0dZR+AlfA@public.gmane.org The curl command will works fine if I don''t pass the -d switch. Thanks in advance for the help. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rein Henrichs
2007-Sep-07 15:27 UTC
Re: Basic Authentication fails with curl using restful_authentication plugin
This is because RESTful Authentication is not an HTTP Authentication system. On Sep 7, 10:14 am, Hardbap <hard...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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:passw...-uj0Z+6/7SLHQT0dZR+AlfA@public.gmane.org > > The curl command will works fine if I don''t pass the -d switch. > > Thanks in advance for the help.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Breen
2007-Sep-07 15:53 UTC
Re: Basic Authentication fails with curl using restful_authentication plugin
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 On 9/7/07, Rein Henrichs <rein.henrichs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > This is because RESTful Authentication is not an HTTP Authentication > system. > > On Sep 7, 10:14 am, Hardbap <hard...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > 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:passw...-uj0Z+6/7SLHQT0dZR+AlfA@public.gmane.org > > > > The curl command will works fine if I don''t pass the -d switch. > > > > Thanks in advance for the help. > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hardbap
2007-Sep-07 15:56 UTC
Re: Basic Authentication fails with curl using restful_authentication plugin
Also, the project log states that this has been added: http://projects.wh.techno-weenie.net/browser/r2943/plugins/restful_authentication/generators/authenticated/templates On Sep 7, 11:27 am, Rein Henrichs <rein.henri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> This is because RESTful Authentication is not an HTTP Authentication > system. > > On Sep 7, 10:14 am, Hardbap <hard...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > 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:passw...-uj0Z+6/7SLHQT0dZR+AlfA@public.gmane.org > > > The curl command will works fine if I don''t pass the -d switch. > > > Thanks in advance for the help.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hardbap
2007-Sep-07 18:14 UTC
Re: Basic Authentication fails with curl using restful_authentication plugin
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. On Sep 7, 11:14 am, Hardbap <hard...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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:passw...-uj0Z+6/7SLHQT0dZR+AlfA@public.gmane.org > > The curl command will works fine if I don''t pass the -d switch. > > Thanks in advance for the help.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hardbap
2007-Sep-07 19:53 UTC
Re: Basic Authentication fails with curl using restful_authentication plugin
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. On Sep 7, 2:14 pm, Hardbap <hard...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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. > > On Sep 7, 11:14 am, Hardbap <hard...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > 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:passw...-uj0Z+6/7SLHQT0dZR+AlfA@public.gmane.org > > > The curl command will works fine if I don''t pass the -d switch. > > > Thanks in advance for the help.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---