From 2c6fe4a88a1e04fb19ae8d5f3ae71d9d066c4e0a Mon Sep 17 00:00:00 2001 From: Toehio Date: Thu, 31 Oct 2013 10:54:48 -0400 Subject: [PATCH] Support for oauth with RSA-SHA1 signing --- request.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/request.js b/request.js index 48e0c06dc..d5152ca25 100644 --- a/request.js +++ b/request.js @@ -1126,8 +1126,7 @@ Request.prototype.oauth = function (_oauth) { if (!oa.oauth_version) oa.oauth_version = '1.0' if (!oa.oauth_timestamp) oa.oauth_timestamp = Math.floor( Date.now() / 1000 ).toString() if (!oa.oauth_nonce) oa.oauth_nonce = uuid().replace(/-/g, '') - - oa.oauth_signature_method = 'HMAC-SHA1' + if (!oa.oauth_signature_method) oa.oauth_signature_method = 'HMAC-SHA1' var consumer_secret = oa.oauth_consumer_secret delete oa.oauth_consumer_secret @@ -1136,7 +1135,7 @@ Request.prototype.oauth = function (_oauth) { var timestamp = oa.oauth_timestamp var baseurl = this.uri.protocol + '//' + this.uri.host + this.uri.pathname - var signature = oauth.hmacsign(this.method, baseurl, oa, consumer_secret, token_secret) + var signature = oauth.sign(oa.oauth_signature_method, this.method, baseurl, oa, consumer_secret, token_secret) // oa.oauth_signature = signature for (var i in form) {