Skip to content

Commit

Permalink
reverting to original version of PBS-LAAS since it shouldnt have chan…
Browse files Browse the repository at this point in the history
…ged for PMSSO
  • Loading branch information
tamw-wnet committed Sep 23, 2024
1 parent 07afe14 commit 0e7afa5
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions classes/class-PBS-LAAS-client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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

Expand Down Expand Up @@ -570,3 +567,4 @@ public function derive_and_append_vppa_status($userinfo) {
return $userinfo;
}
}

0 comments on commit 0e7afa5

Please sign in to comment.