From 975978730993ce708666fee74abc4ae9294cd202 Mon Sep 17 00:00:00 2001 From: Anna van Brecht Date: Wed, 26 Feb 2025 10:14:36 +0100 Subject: [PATCH 1/4] Use form-params to set token --- src/BaseClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BaseClient.php b/src/BaseClient.php index 1fc139c..2492d04 100644 --- a/src/BaseClient.php +++ b/src/BaseClient.php @@ -277,7 +277,7 @@ protected function requestToken(string $clientId, string $clientSecret, TokenReq 'Authorization' => sprintf('Basic %s', $credentials), 'Content-Type' => 'application/x-www-form-urlencoded', ], - 'body' => http_build_query($token->toArray()) + 'form-params' => http_build_query($token->toArray()) ]); $responseTypes = [ From 30c2e229e3f4092f87b1038d61be800cc92f720f Mon Sep 17 00:00:00 2001 From: Anna van Brecht Date: Wed, 26 Feb 2025 10:15:44 +0100 Subject: [PATCH 2/4] Fix --- src/BaseClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BaseClient.php b/src/BaseClient.php index 2492d04..4384c8e 100644 --- a/src/BaseClient.php +++ b/src/BaseClient.php @@ -277,7 +277,7 @@ protected function requestToken(string $clientId, string $clientSecret, TokenReq 'Authorization' => sprintf('Basic %s', $credentials), 'Content-Type' => 'application/x-www-form-urlencoded', ], - 'form-params' => http_build_query($token->toArray()) + 'form_params' => $token->toArray() ]); $responseTypes = [ From ba337edc337ed179432c72e226a190dfad1eb12d Mon Sep 17 00:00:00 2001 From: Anna van Brecht Date: Wed, 26 Feb 2025 10:26:20 +0100 Subject: [PATCH 3/4] Fix form_params in test --- tests/ClientTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ClientTest.php b/tests/ClientTest.php index 4a49d53..1b0125a 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -44,7 +44,7 @@ protected function authenticateByClientCredentials() 'Authorization' => 'Basic ' . $credentials, 'Content-Type' => 'application/x-www-form-urlencoded' ], - 'body' => 'grant_type=client_credentials' + 'form_params' => 'grant_type=client_credentials' ])->willReturn($response); // use the HttpClient mock created in this method for authentication, put the original one back afterwards From 0bae2deb491e9a61f4d5e93591d5aea6f69724e6 Mon Sep 17 00:00:00 2001 From: Anna van Brecht Date: Wed, 26 Feb 2025 10:28:23 +0100 Subject: [PATCH 4/4] Use form_params --- tests/BaseClientTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/BaseClientTest.php b/tests/BaseClientTest.php index c13f86f..1920911 100644 --- a/tests/BaseClientTest.php +++ b/tests/BaseClientTest.php @@ -235,7 +235,7 @@ protected function authenticateByClientCredentials(?ResponseInterface $response 'Authorization' => 'Basic ' . $credentials, 'Content-Type' => 'application/x-www-form-urlencoded' ], - 'body' => 'grant_type=client_credentials' + 'form_params' => 'grant_type=client_credentials' ])->willReturn($response); // use the HttpClient mock created in this method for authentication, put the original one back afterwards