diff --git a/classes/class-PBS-LAAS-client.php b/classes/class-PBS-LAAS-client.php index ea1f007..1c7c95c 100644 --- a/classes/class-PBS-LAAS-client.php +++ b/classes/class-PBS-LAAS-client.php @@ -33,7 +33,7 @@ Public Methods: -authenticate($code, $rememberme, $nonce='', $code_exchange='') +authenticate($code, $rememberme) Takes an oAuth grant code and use it to get access and refresh tokens from PBS then stores tokens and userinfo in encrypted session variables. the second arg determines if this info is stored in encryped cookies for longer term. @@ -129,13 +129,13 @@ private function build_curl_handle($url) { - public function authenticate($code= '', $rememberme='', $nonce='', $code_verifier= ''){ + public function authenticate($code= '', $rememberme='', $nonce=''){ $this->checknonce = $nonce; $this->rememberme = $rememberme; - $tokeninfo = $this->get_code_response($code, $code_verifier); + $tokeninfo = $this->get_code_response($code); if (! isset($tokeninfo["access_token"]) ) { $tokeninfo['messages'] = 'broke on code response'; return $tokeninfo; @@ -161,8 +161,8 @@ public function authenticate($code= '', $rememberme='', $nonce='', $code_verifie } - public function code_exchange($code= '', $code_verifier= ''){ - $tokeninfo = $this->get_code_response($code, $code_verifier); + public function code_exchange($code= ''){ + $tokeninfo = $this->get_code_response($code); if (! isset($tokeninfo["access_token"]) ) { $tokeninfo['messages'] = 'broke on code exchange'; return $tokeninfo; @@ -244,7 +244,7 @@ public function logout() { } - private function get_code_response($code='', $code_verifier=''){ + private function get_code_response($code=''){ $url = $this->oauthroot . 'token/'; $postfields = array( 'code' => $code, @@ -253,9 +253,6 @@ private function get_code_response($code='', $code_verifier=''){ 'client_secret' => $this->client_secret, 'grant_type' => 'authorization_code' ); - if (!empty($code_verifier)) { - $postfields['code_verifier'] = $code_verifier; - } $ch = $this->build_curl_handle($url); //construct the curl request @@ -570,3 +567,4 @@ public function derive_and_append_vppa_status($userinfo) { return $userinfo; } } +