Posted by kscheirer on January 10, 2013 at 3:56am
I'm just getting started with node.js, and I'm hoping you guys can point e in the right direction.
I want to be able to log in to my Drupal site, what kind of add on do I need for this (if any). When using PHP's curl, you're able to post to a login form and then keep the cookie for future requests - which lets you interact with your site as an authenticated user.
Thanks in advance for any advice,
-ks

Comments
I think this might help, but
I think this might help, but I could sure use some code examples! https://github.com/andris9/fetch
When you say you want to use
When you say you want to use node.js to log in to your Drupal site - how do you mean exactly?
Do you mean that node.js itself will be authenticated as a user?
What sort of purpose would this be for because there could potentially be an easier way.
I know most of the examples
I know most of the examples for node.js are created server-side apps. I'm looking at it more as a client app - ie I want to be able to log into my Drupal site and do some actions as an authenticated user.
The logic would be something like :
Issue a POST with username & password to /user/login form. This should send me back a authenticated session cookie.
Make a second POST request (with the auth cookie) to /node/add/article to create a new article.
You might want to look into
You might want to look into something like the request module which is an abstracted http client lib: https://npmjs.org/package/request.
Also, if you want something a little bit more full featured, you could look into phantomjs which is a full browser emulator: https://github.com/ariya/phantomjs/ (i.e. it should be able to store cookies automatically without any intervention).
Alternatively if it's posting
Alternatively if it's posting articles you could go the way of the blogapi module and use XMLRPC.