From b0c32a260cb6866197fa7f3da6c2bf3a711a9c41 Mon Sep 17 00:00:00 2001 From: Joseph Bielawski Date: Sun, 20 Aug 2023 18:04:53 +0200 Subject: [PATCH] Use newer version of `firebase/php-jwt` library --- CHANGELOG.md | 1 + composer.json | 2 +- src/OAuth/ResourceOwner/AppleResourceOwner.php | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdf9fe99f..838195ed3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Changelog * Bugfix: Catch also the `TransportExceptionInterface` in `AbstractResourceOwner::getResponseContent()` method, * Bugfix: Current matched Firewall is respected during generation of resource owner check path links, * Bugfix: Prevent fatal error in `OAuthUserProvider::loadUserByOAuthUserResponse()` when `nickname` is not available in OAuth response, +* Bugfix: Use newer version of `firebase/php-jwt` library, * Chore: Removed not used Symfony Templating component ## 2.0.0-BETA2 (2022-01-16) diff --git a/composer.json b/composer.json index b3f8a9f80..ef921418b 100644 --- a/composer.json +++ b/composer.json @@ -120,7 +120,7 @@ "phpstan/phpstan": "^1.2", "phpstan/phpstan-symfony": "^1.0", "phpstan/extension-installer": "^1.1", - "firebase/php-jwt": "^5.5" + "firebase/php-jwt": "^6.8" }, "config": { diff --git a/src/OAuth/ResourceOwner/AppleResourceOwner.php b/src/OAuth/ResourceOwner/AppleResourceOwner.php index 56c28db5b..940dbb395 100644 --- a/src/OAuth/ResourceOwner/AppleResourceOwner.php +++ b/src/OAuth/ResourceOwner/AppleResourceOwner.php @@ -183,7 +183,7 @@ private function getClientSecret(): string throw new \RuntimeException('PHP-JWT library is required to use automatic "client_secret" generation. Please try "composer require firebase/php-jwt".'); } - $playload = [ + $payload = [ 'iss' => $this->options['team_id'], 'iat' => time(), 'exp' => time() + 600, @@ -191,6 +191,6 @@ private function getClientSecret(): string 'sub' => $this->options['client_id'], ]; - return JWT::encode($playload, $this->options['auth_key'], 'ES256', $this->options['key_id']); + return JWT::encode($payload, $this->options['auth_key'], 'ES256', $this->options['key_id']); } }