Skip to content

Commit 23b02d0

Browse files
committed
bump to php-jwt 6.0 and remove temporary code
1 parent 71cfa8a commit 23b02d0

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"require-dev": {
2121
"cakephp/cakephp": "^4.0",
2222
"cakephp/cakephp-codesniffer": "^4.0",
23-
"firebase/php-jwt": "^5.5",
23+
"firebase/php-jwt": "^6.0",
2424
"phpunit/phpunit": "^8.5 || ^9.3"
2525
},
2626
"suggest": {

src/Authenticator/JwtAuthenticator.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
use ArrayObject;
2020
use Authentication\Identifier\IdentifierInterface;
21-
use Cake\Utility\Hash;
2221
use Cake\Utility\Security;
2322
use Exception;
2423
use Firebase\JWT\JWK;
@@ -172,14 +171,6 @@ protected function decodeToken(string $token): ?object
172171
$jsonWebKeySet = $this->getConfig('jwks');
173172
if ($jsonWebKeySet) {
174173
$keySet = JWK::parseKeySet($jsonWebKeySet);
175-
/*
176-
* TODO Converting Keys to Key Objects is no longer needed in firebase/php-jwt ^6.0
177-
* @link https://github.com/firebase/php-jwt/pull/376/files#diff-374f5998b3c572d86be0e79432aac3de362c79e8fb146b9ce422dc2388cdc5daR50
178-
*/
179-
$keyAlgorithms = Hash::combine($jsonWebKeySet['keys'], '{n}.kid', '{n}.alg');
180-
array_walk($keySet, function (&$keyMaterial, $k) use ($keyAlgorithms) {
181-
$keyMaterial = new Key($keyMaterial, $keyAlgorithms[$k]);
182-
});
183174

184175
return JWT::decode(
185176
$token,

0 commit comments

Comments
 (0)