Jump to content
McKay Development

login through oauth2 from third party website


Revadike

Recommended Posts

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)
            });
        });
Link to comment
Share on other sites

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) { ... }
Link to comment
Share on other sites

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 by Royalgamer06
Link to comment
Share on other sites

  • 6 years later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...