Fix for redirect behavior #54

Open
wants to merge 4 commits into
from

Projects

None yet

3 participants

@baryshev

oauth.js and oauth2.js has different behaviours when sending/responding request. I fix it.
Another problem: It`s impossible to obtain url of 302 redirection in oauth1/oauth2 get/post methods callback.

Oauth1 automatically followed 302 redirects.
Oauth2 not sent response parameter to callback if code != 200.

For example:
https://dev.twitter.com/docs/api/1/get/users/profile_image/%3Ascreen_name
and
http://developers.facebook.com/docs/reference/api/user/ (search picture or 302 keywords on page).

It needs to catch url of redirection.

I fix it.

Best Regards,
Vadim Baryshev

P.S. sory, my english is not very well.

baryshev added some commits Jul 20, 2011
@baryshev baryshev Removed support for automatically following 302 redirects. It makes i…
…mpossible to obtain the forwarding url. E.g. Twitter and Facebook API's returns a 302 redirect to the actual image resource instead common response.
82ac1a3
@baryshev baryshev Improved handling of 2xx responses. Added response data and response …
…resource to callback when status is not 2xx
ed365e6
@baryshev baryshev Added parameter to getOAuthAccessToken callback that contains additio…
…nal server data
d8529bc
@baryshev

Also I added parameter to getOAuthAccessToken callback that contains additional server data to oauth2.js. oauth.js already have it.

@baryshev baryshev Merged with ciaranj/node-oauth. Improved _isParameterNameAnOAuthParam…
…eter method in oauth.js to work with oauth_ prefixed extra parameters where not in OAuth specifications. Now works with MySpace OAuth
d65eb6d
@gidzone

this is awesome. I had to write a hack in one of my routes to do the 302. Salesforce does a 302 when you get bounced to the login page. This will help solve that problem!

@ciaranj
Owner

I will get around to merging this promise ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment