From af9bfa1d4a36418370cab924c05952a03aa930d2 Mon Sep 17 00:00:00 2001 From: Wise-Gorilla <65309837+Wise-Gorilla@users.noreply.github.com> Date: Wed, 13 May 2020 21:34:19 +0200 Subject: [PATCH 1/2] Fix OAuth Authorization This edit fix the oAuth issue that raised when changed the POST to use json_encode instead of http_build_query #216 --- lib/Auth/OAuth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Auth/OAuth.php b/lib/Auth/OAuth.php index b073491f..64074517 100755 --- a/lib/Auth/OAuth.php +++ b/lib/Auth/OAuth.php @@ -592,7 +592,7 @@ protected function prepareRequest($url, array $headers, array $parameters, $meth //OAuth 2.0 $this->log('making request using OAuth2 spec'); - $parameters['access_token'] = $this->_access_token; + $headers[] = 'Authorization: Bearer ' . $this->_access_token; } return [$headers, $parameters]; From 4ca09c2ac4a06c71c12f09d0cb2378906387a80b Mon Sep 17 00:00:00 2001 From: Dennis Ameling Date: Sat, 10 Oct 2020 21:20:17 +0200 Subject: [PATCH 2/2] Fix CS --- lib/Auth/AbstractAuth.php | 2 +- lib/Auth/OAuth.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Auth/AbstractAuth.php b/lib/Auth/AbstractAuth.php index 4c758ebd..eb8eaf46 100644 --- a/lib/Auth/AbstractAuth.php +++ b/lib/Auth/AbstractAuth.php @@ -146,7 +146,7 @@ public function makeRequest($url, array $parameters = [], $method = 'GET', array $headers[] = 'Content-Type: multipart/form-data'; } else { $parameters = json_encode($parameters); - $headers[] = "Content-Type: application/json"; + $headers[] = 'Content-Type: application/json'; } $options[CURLOPT_POST] = true; diff --git a/lib/Auth/OAuth.php b/lib/Auth/OAuth.php index 64074517..fc963560 100755 --- a/lib/Auth/OAuth.php +++ b/lib/Auth/OAuth.php @@ -592,7 +592,7 @@ protected function prepareRequest($url, array $headers, array $parameters, $meth //OAuth 2.0 $this->log('making request using OAuth2 spec'); - $headers[] = 'Authorization: Bearer ' . $this->_access_token; + $headers[] = 'Authorization: Bearer '.$this->_access_token; } return [$headers, $parameters];