Search code examples
ruby-on-railsrestful-authenticationremote-forms

Remote login into Rails 2 application


I am working on signing in a Rails 2 app remotely. Given that Rails methods are RESTful by default, I am assuming all I have to do would be POSTing form data from the remote application (a Facebook App actually). For some reason, this doesn't seem to work, I've tried:

curl http://www.zouz.com/session -d user[email][email protected] -d user[password]=whocares

which returns and empty result. I suspected Rails' built in forgery protection might be the cause, deactivating it won't make it work.

Is there something wrong with my method ?

EDIT : If it's any help, processing the same POST query with HTTPRequester does work, although I provided the same input.


Solution

  • I managed to get it working, thanks to the -u flag.

     curl --user [email protected]:whocares http://192.168.1.19:3000
    

    This is still cryptic to me, as I still don't know how it operates under the hood. Explanations are still welcome.