Skip to content

Commit f9a912d

Browse files
Stefan WeilUBMA Sysadmins
authored andcommitted
Replace $access_token and $request_token by camel case names in OpenIDConnect.php
1 parent 52b2e8f commit f9a912d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

module/VuFind/src/VuFind/Auth/OpenIDConnect.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public function authenticate($request): UserEntityInterface
247247
if (empty($code)) {
248248
throw new AuthException('authentication_error_admin');
249249
}
250-
$request_token = $this->getRequestToken($code);
250+
$requestToken = $this->getRequestToken($code);
251251
$state = $request->getQuery()->get('state');
252252
$currentState = $this->session->oidc_state;
253253
$stateIsValid = $state === $currentState;
@@ -257,7 +257,7 @@ public function authenticate($request): UserEntityInterface
257257
throw new AuthException('authentication_error_technical');
258258
}
259259

260-
$claims = $this->decodeJWT($request_token->id_token);
260+
$claims = $this->decodeJWT($requestToken->id_token);
261261

262262
if (!$this->validateIssuer($claims->iss)) {
263263
$this->logError('Wrong issuer: ' . $claims->iss);
@@ -270,11 +270,11 @@ public function authenticate($request): UserEntityInterface
270270
throw new AuthException('authentication_error_technical');
271271
}
272272

273-
$accessToken = $request_token->access_token;
273+
$accessToken = $requestToken->access_token;
274274
$userInfo = $this->getUserInfo($accessToken);
275275

276276
// Store id_token in session for logout
277-
$this->session->oidc_id_token = $request_token->id_token;
277+
$this->session->oidc_id_token = $requestToken->id_token;
278278

279279
return $this->setUserAttributes($userInfo);
280280
}
@@ -474,18 +474,18 @@ protected function getRequestToken(string $code): object
474474
/**
475475
* Given an access token, look up user details.
476476
*
477-
* @param string $access_token Access token
477+
* @param string $accessToken Access token
478478
*
479479
* @return object
480480
* @throws AuthException
481481
*/
482-
protected function getUserInfo(string $access_token): object
482+
protected function getUserInfo(string $accessToken): object
483483
{
484484
$url = $this->getProvider()->userinfo_endpoint;
485485
$params = [
486486
'schema' => 'openid',
487487
];
488-
$headers = ['Authorization: Bearer ' . $access_token];
488+
$headers = ['Authorization: Bearer ' . $accessToken];
489489
try {
490490
$response = $this->httpService->get($url, $params, null, $headers);
491491
} catch (\Exception $e) {

0 commit comments

Comments
 (0)