patrickbussmann / oauth2-apple

Sign in with Apple Provider for the OAuth 2.0 Client
MIT License
95 stars 64 forks source link

Firebase\JWT\JWT::decode(): Argument #3 ($headers) cannot be passed by reference in src/Token/AppleAccessToken.php:50 #46

Open tadaszelvys opened 1 year ago

julienbornstein commented 1 year ago

until it is fixed, lock firebase/php-jwt to previous version

composer req firebase/php-jwt:6.5.0

itaynoy commented 1 year ago

A quick fix for the issue is to change line 50 in src/Token/AppleAccessToken.php to:

 $s = (object) ["alg" => 'RS256'];
 $decoded = JWT::decode($options['id_token'], $key, $s);

that will work with later version of JWT (tested on 6.8)

bobmagicii commented 1 year ago

ran into this first thing this week. causes the most randomly seemingly intermittent failure to auth. did the version rollback of jwt. gonna try the fix itaynoy posted.

bobmagicii commented 1 year ago

this seems to be the commit that did it for reference.

https://github.com/firebase/php-jwt/commit/fb85f47cfaeffdd94faf8defdf07164abcdad6c3

it is a questionable design choice in 2023.