Revadike Posted April 13, 2017 Report Posted April 13, 2017 Say, I'd like to login to this website using Steam via NodeJS. How do I go about doing that? I tried a dirty solution, but it doesn't redirect me to the third party website callback url. community.httpRequestGet(url, {}, function(error, response, data) { var url = $("#openidForm", data).attr("action"); var formdata = $("#openidForm", data).serializeObject(); community.httpRequestPost(url, formdata, function(error, response, data) { console.log(error, response.statusCode); console.dir(response.headers) }); }); Quote
Dr. McKay Posted April 13, 2017 Report Posted April 13, 2017 Try specifying followAllRedirects = true. Request won't follow redirects for non-GET methods otherwise. Quote
Revadike Posted April 13, 2017 Author Report Posted April 13, 2017 Try specifying followAllRedirects = true. Request won't follow redirects for non-GET methods otherwise. I thought I tried that already, but now it works! Now I have: var url = $("#openidForm", data).attr("action"); var formdata = $("#openidForm", data).serializeObject(); community.httpRequestPost(url, { followAllRedirects: true, formData: formdata }, function(error, response, data) { ... } Quote
Revadike Posted April 13, 2017 Author Report Posted April 13, 2017 (edited) I can't seem to get the cookies/session of the logged in site.Can I somehow set request = request.defaults({jar: true}); for httpRequestPost? Nevermind, I was able to get the PHPSESSION cookie via response.request.headers.cookie Edited April 13, 2017 by Royalgamer06 Quote
someone Posted October 27, 2023 Report Posted October 27, 2023 Is this algorithm still relevant? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.