Skip to content

Commit

Permalink
Fixed issue with JWT 5 and supported methods
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbussmann committed May 9, 2022
1 parent 51c96fb commit 3a4576b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ jobs:
- '7.3'
- '7.4'
- '8.0'
dependencies:
- 'lowest'
- 'highest'
experimental:
- false
include:
Expand All @@ -73,6 +76,7 @@ jobs:
run: 'mkdir -p build/logs'
- uses: 'ramsey/composer-install@v1'
with:
dependency-versions: '${{ matrix.dependencies }}'
composer-options: '${{ matrix.composer-options }}'
- name: 'Run unit tests'
run: './vendor/bin/phpunit --colors=always --coverage-clover build/logs/clover.xml'
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ All Notable changes to `oauth2-apple` will be documented in this file
### Security
- Nothing

## 0.2.8 - 2022-05-10

### Fixed
- Issue with firebase/php-jwt v5 [#34](https://github.com/patrickbussmann/oauth2-apple/issues/34) (thanks to [tjveldhuizen](https://github.com/tjveldhuizen))

## 0.2.7 - 2022-04-29

### Added
Expand Down
6 changes: 5 additions & 1 deletion src/Token/AppleAccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ public function __construct(array $keys, array $options = [])
$last = end($keys);
foreach ($keys as $key) {
try {
$decoded = JWT::decode($options['id_token'], $key);
try {
$decoded = JWT::decode($options['id_token'], $key);
} catch (\UnexpectedValueException $e) {
$decoded = JWT::decode($options['id_token'], $key, ['RS256']);
}
break;
} catch (\Exception $exception) {
if ($last === $key) {
Expand Down

0 comments on commit 3a4576b

Please sign in to comment.