diff --git a/composer.json b/composer.json index c34a244..3fe9980 100644 --- a/composer.json +++ b/composer.json @@ -4,9 +4,9 @@ "license": "MIT", "authors": [ { - "name": "Patrick Bußmann", - "email": "patrick.bussmann@bussmann-it.de", - "homepage": "https://github.com/patrickbussmann" + "name": "Rainer Adelstone", + "email": "rainer.adelstone@gmail.com", + "homepage": "https://github.com/adelstone" } ], "keywords": [ diff --git a/src/Token/AppleAccessToken.php b/src/Token/AppleAccessToken.php index cbb8b9b..228f972 100644 --- a/src/Token/AppleAccessToken.php +++ b/src/Token/AppleAccessToken.php @@ -42,12 +42,15 @@ public function __construct(array $keys, array $options = []) $decoded = null; $last = end($keys); + $headers = new \stdClass(); + $headers->alg = 'ES256'; + foreach ($keys as $key) { try { try { $decoded = JWT::decode($options['id_token'], $key); } catch (\UnexpectedValueException $e) { - $decoded = JWT::decode($options['id_token'], $key, ['RS256']); + $decoded = JWT::decode($options['id_token'], $key, $headers); } break; } catch (\Exception $exception) { @@ -56,6 +59,7 @@ public function __construct(array $keys, array $options = []) } } } + if (null === $decoded) { throw new \Exception('Got no data within "id_token"!'); }