Skip to content

Loading…

Support for OAuth with RSA-SHA1 signing #695

Closed
wants to merge 1 commit into from

2 participants

@toehio

Lets you choose the signature_method for OAuth.

This depends on the pull request I just made to your oauth-sign: request/oauth-sign#7

@toehio toehio referenced this pull request in request/oauth-sign
Merged

Feature/sign rsa #7

@mikeal
request member

no longer merges cleanly :(

@mikeal mikeal closed this
@toehio

I've rebased the commits in my PR and have a new one here: #1042

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 31, 2013
  1. Support for oauth with RSA-SHA1 signing

    Toehio committed
Showing with 2 additions and 3 deletions.
  1. +2 −3 request.js
View
5 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) {
Something went wrong with that request. Please try again.