Fix for redirect behavior #54

wants to merge 4 commits into


None yet

3 participants


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:
and (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.
@baryshev baryshev Improved handling of 2xx responses. Added response data and response …
…resource to callback when status is not 2xx
@baryshev baryshev Added parameter to getOAuthAccessToken callback that contains additio…
…nal server data

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

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!


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