From 8f4f0feb0d97a2d5c4b0432b50111c76756265e4 Mon Sep 17 00:00:00 2001 From: William Tam Date: Mon, 16 Sep 2024 14:27:23 -0400 Subject: [PATCH] tweak to code exchage request --- classes/class-PMSSO-Client.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/classes/class-PMSSO-Client.php b/classes/class-PMSSO-Client.php index 44fd07d..6ffa4e1 100644 --- a/classes/class-PMSSO-Client.php +++ b/classes/class-PMSSO-Client.php @@ -252,16 +252,15 @@ private function get_code_response($code='', $code_verifier=''){ $url = $this->oauthroot . 'login/token/'; $postfields = array( 'code' => $code, - 'redirect_uri' => $this->redirect_uri, 'client_id' => $this->client_id, 'grant_type' => 'authorization_code', 'code_verifier' => $code_verifier ); + $requestbody=http_build_query($postfields); $ch = $this->build_curl_handle($url); //construct the curl request - error_log("code response request to $url uses " . json_encode($postfields)); curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); + curl_setopt($ch, CURLOPT_POSTFIELDS, $requestbody); $response_json = curl_exec($ch); $info = curl_getinfo($ch); $errors = curl_error($ch);