Merge branch 'master' of http://github.com/ciaranj/node-oauth
Conflicts: lib/oauth.js
This commit is contained in:
commit
0b4353bd38
@ -9,7 +9,8 @@ at express-auth (http://github.com/ciaranj/express-auth)
|
|||||||
|
|
||||||
Change History
|
Change History
|
||||||
==============
|
==============
|
||||||
|
* 0.7.7 - Looks like non oauth_ parameters where appearing within the Authorization headers, which I believe to be inccorrect.
|
||||||
|
* 0.7.6 - Added in oauth_verifier property to getAccessToken required for 1.0A
|
||||||
* 0.7.5 - Added in a main.js to simplify the require'ing of OAuth
|
* 0.7.5 - Added in a main.js to simplify the require'ing of OAuth
|
||||||
* 0.7.4 - Minor change to add an error listener to the OAuth client (thanks troyk)
|
* 0.7.4 - Minor change to add an error listener to the OAuth client (thanks troyk)
|
||||||
* 0.7.3 - OAuth 2 now sends a Content-Length Http header to keep nginx happy :)
|
* 0.7.3 - OAuth 2 now sends a Content-Length Http header to keep nginx happy :)
|
||||||
|
11
lib/oauth.js
11
lib/oauth.js
@ -194,8 +194,12 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke
|
|||||||
// build request authorization header
|
// build request authorization header
|
||||||
var authHeader="OAuth ";
|
var authHeader="OAuth ";
|
||||||
for( var i= 0 ; i < orderedParameters.length; i++) {
|
for( var i= 0 ; i < orderedParameters.length; i++) {
|
||||||
|
// Whilst the all the parameters should be included within the signature, only the oauth_ arguments
|
||||||
|
// should appear within the authorization header.
|
||||||
|
if( orderedParameters[i][0].match('^oauth_') == "oauth_") {
|
||||||
authHeader+= this._encodeData(orderedParameters[i][0])+"=\""+ this._encodeData(orderedParameters[i][1])+"\",";
|
authHeader+= this._encodeData(orderedParameters[i][0])+"=\""+ this._encodeData(orderedParameters[i][1])+"\",";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
authHeader= authHeader.substring(0, authHeader.length-1);
|
authHeader= authHeader.substring(0, authHeader.length-1);
|
||||||
|
|
||||||
headers["Authorization"]= authHeader;
|
headers["Authorization"]= authHeader;
|
||||||
@ -233,11 +237,14 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke
|
|||||||
request.end();
|
request.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.OAuth.prototype.getOAuthAccessToken= function(oauth_token, oauth_token_secret, oauth_verifier, callback) {
|
exports.OAuth.prototype.getOauthAccessToken= function(oauth_token, oauth_token_secret, oauth_verifier, callback) {
|
||||||
var extraParams= {};
|
var extraParams= {};
|
||||||
if( oauth_verifier ) {
|
if( typeof oauth_verifier == "function" ) {
|
||||||
|
callback= oauth_verifier;
|
||||||
|
} else {
|
||||||
extraParams.oauth_verifier= oauth_verifier;
|
extraParams.oauth_verifier= oauth_verifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._performSecureRequest( oauth_token, oauth_token_secret, "GET", this._accessUrl, extraParams, function(error, data, response) {
|
this._performSecureRequest( oauth_token, oauth_token_secret, "GET", this._accessUrl, extraParams, function(error, data, response) {
|
||||||
if( error ) callback(error);
|
if( error ) callback(error);
|
||||||
else {
|
else {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ "name" : "oauth"
|
{ "name" : "oauth"
|
||||||
, "version" : "0.7.5"
|
, "version" : "0.7.7"
|
||||||
, "directories" : { "lib" : "./lib" }
|
, "directories" : { "lib" : "./lib" }
|
||||||
, "main" : "main.js"
|
, "main" : "main.js"
|
||||||
, "author" : "Ciaran Jessup"
|
, "author" : "Ciaran Jessup"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user