diff --git a/CHANGELOG.md b/CHANGELOG.md index d4be9ff7..1e93e732 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.1] + +### Changed + +- Fix unnecessary client_id in token params. Which can issue errors in OIDC providers authentication with PKCE support. Fixes [issue](https://github.com/jumbojett/OpenID-Connect-PHP/issues/312) +- Remove type hints for `getAccessToken`, `getRefreshToken`, `getIdToken` because when calling this method, in case the OIDC provider did not send these tokens to the application, may cause error in application, since variables `accessToken`, `refreshToken`, `idToken` still null + ## [1.0.0] - 2023-12-13 ### Added diff --git a/src/OpenIDConnectClient.php b/src/OpenIDConnectClient.php index 6aa80b17..5f576211 100644 --- a/src/OpenIDConnectClient.php +++ b/src/OpenIDConnectClient.php @@ -918,10 +918,8 @@ protected function requestTokens(string $code, array $headers = []) { $authorizationHeader = null; unset($token_params['client_secret']); } - $token_params = array_merge($token_params, [ - 'client_id' => $this->clientID, - 'code_verifier' => $this->getCodeVerifier() - ]); + + $token_params['code_verifier'] = $this->getCodeVerifier(); } // Convert token params to string format @@ -1717,22 +1715,34 @@ public function getClientSecret() { * Set the access token. * * May be required for subclasses of this Client. + * + * @param string|null $accessToken */ - public function setAccessToken(string $accessToken) { + public function setAccessToken($accessToken) { $this->accessToken = $accessToken; } - public function getAccessToken(): string + + /** + * @return string|null + */ + public function getAccessToken() { return $this->accessToken; } - public function getRefreshToken(): string + /** + * @return string|null + */ + public function getRefreshToken() { return $this->refreshToken; } - public function getIdToken(): string + /** + * @return string|null + */ + public function getIdToken() { return $this->idToken; }