From b75dd32ba55e92f5a0f11f3bb9891069260f600a Mon Sep 17 00:00:00 2001 From: Alexis King Date: Thu, 13 Oct 2016 10:09:53 -0700 Subject: [PATCH] Pass Basic Authorization header to OAuth2 access token request fixes #143, #175, #205, and #300 --- lib/oauth2.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/oauth2.js b/lib/oauth2.js index 94ed662c..91a51218 100644 --- a/lib/oauth2.js +++ b/lib/oauth2.js @@ -169,7 +169,8 @@ exports.OAuth2.prototype.getOAuthAccessToken= function(code, params, callback) { var post_data= querystring.stringify( params ); var post_headers= { - 'Content-Type': 'application/x-www-form-urlencoded' + 'Content-Type': 'application/x-www-form-urlencoded', + 'Authorization': 'Basic ' + new Buffer(this._clientId + ':' + this._clientSecret).toString('base64') };