I'm using node.js with the request.js module to make authenticated https requests like so.
username = req.body.username;
password = req.body.password;
var url = 'https://' + username + ':' + password + '@domain.com';
request({
url : url,
}, function (error, response, body){
//do something here
});
Is there another way to do this without having the node.js server make this call without exposing the password in plain text?
For example, say I went to http://domain.com and logged in with my credentials. I can then close my browser, revisit http://domain.com and be automagically logged in. Can I then visit my node.js app (localhost:3000) and make subsequent requests using the node app without explicitly reentering my password?