Merge branch 'master' of http://github.com/ciaranj/node-oauth
Conflicts: lib/oauth.js
This commit is contained in:
19
lib/oauth.js
19
lib/oauth.js
@ -193,8 +193,12 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke
|
||||
|
||||
// build request authorization header
|
||||
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= authHeader.substring(0, authHeader.length-1);
|
||||
|
||||
@ -233,11 +237,14 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke
|
||||
request.end();
|
||||
}
|
||||
|
||||
exports.OAuth.prototype.getOAuthAccessToken= function(oauth_token, oauth_token_secret, oauth_verifier, callback) {
|
||||
var extraParams = {};
|
||||
if( oauth_verifier ) {
|
||||
extraParams.oauth_verifier = oauth_verifier;
|
||||
}
|
||||
exports.OAuth.prototype.getOauthAccessToken= function(oauth_token, oauth_token_secret, oauth_verifier, callback) {
|
||||
var extraParams= {};
|
||||
if( typeof oauth_verifier == "function" ) {
|
||||
callback= oauth_verifier;
|
||||
} else {
|
||||
extraParams.oauth_verifier= oauth_verifier;
|
||||
}
|
||||
|
||||
this._performSecureRequest( oauth_token, oauth_token_secret, "GET", this._accessUrl, extraParams, function(error, data, response) {
|
||||
if( error ) callback(error);
|
||||
else {
|
||||
|
Reference in New Issue
Block a user