From 4a4e3d3baf60853666d1c729031d878b6627920e Mon Sep 17 00:00:00 2001 From: Baterka Date: Sat, 12 Dec 2020 19:48:54 +0100 Subject: [PATCH] Added Basic Auth header to `getOAuthAccessToken` http request --- lib/oauth2.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/oauth2.js b/lib/oauth2.js index 77241c43..43c1f88e 100644 --- a/lib/oauth2.js +++ b/lib/oauth2.js @@ -183,7 +183,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 ' + Buffer.from(params['client_id'] + ':' + params['client_secret']).toString('base64') };