Skip to content

Commit 74b5bd1

Browse files
committed
Encode consumerSecret, back out change that exposes req.
1 parent d7c35aa commit 74b5bd1

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/passport-http-oauth/strategies/consumer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ ConsumerStrategy.prototype.authenticate = function(req) {
289289
, base = utils.constructBaseString(req.method, normalizedURL, normalizedParams);
290290

291291
if (signatureMethod == 'HMAC-SHA1') {
292-
var key = consumerSecret + '&';
292+
var key = utils.encode(consumerSecret) + '&';
293293
if (tokenSecret) { key += utils.encode(tokenSecret); }
294294
var computedSignature = utils.hmacsha1(key, base);
295295

lib/passport-http-oauth/strategies/token.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ function TokenStrategy(options, consumer, verify, validate) {
117117
this._host = options.host || null;
118118
this._realm = options.realm || 'Users';
119119
this._ignoreVersion = options.ignoreVersion || false;
120-
this.req = null;
121120
}
122121

123122
/**
@@ -136,7 +135,6 @@ TokenStrategy.prototype.authenticate = function(req) {
136135
var params = undefined
137136
, header = null;
138137

139-
this.req = req;
140138
if (req.headers && req.headers['authorization']) {
141139
var parts = req.headers['authorization'].split(' ');
142140
if (parts.length >= 2) {
@@ -221,7 +219,7 @@ TokenStrategy.prototype.authenticate = function(req) {
221219
, base = utils.constructBaseString(req.method, normalizedURL, normalizedParams);
222220

223221
if (signatureMethod == 'HMAC-SHA1') {
224-
var key = consumerSecret + '&';
222+
var key = utils.encode(consumerSecret) + '&';
225223
if (tokenSecret) { key += utils.encode(tokenSecret); }
226224
var computedSignature = utils.hmacsha1(key, base);
227225

0 commit comments

Comments
 (0)