Skip to content

Commit cd2de9f

Browse files
committed
Encode secrets before computing signature.
1 parent fef2bfa commit cd2de9f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ ConsumerStrategy.prototype.authenticate = function(req) {
298298
}
299299

300300
} else if (signatureMethod === 'HMAC-SHA256') {
301-
var key = consumerSecret + '&';
302-
if (tokenSecret) { key += tokenSecret; }
301+
var key = utils.encode(consumerSecret) + '&';
302+
if (tokenSecret) { key += utils.encode(tokenSecret); }
303303
var computedSignature = utils.hmacsha256(key, base);
304304

305305
if (signature !== computedSignature) {

0 commit comments

Comments
 (0)