Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Error: Firebase\JWT\JWT::decode(): Argument #3 ($headers) cannot be passed by reference #188

Open
ysipd26020 opened this issue Jun 15, 2023 · 16 comments

Comments

@ysipd26020
Copy link

When using "firebase/php-jwt": "6.7.0" the JWT cannot decoded because the handling of the third parameter ($headers) has changed in version 6.6.0 and later.

Forcing the composer.json to use 6.5.0 allows the JWT to be decoded.

I'm assuming that this upstream change is the breaking commit

firebase/php-jwt@fb85f47

Thanks

@10n
Copy link
Contributor

10n commented Jun 15, 2023

Currently the release 2.1.1 has the following dependency "php": "^7.1|^8.0",

https://github.com/TheNetworg/oauth2-azure/blob/v2.1.1/composer.json

My suggestion is to drop entirely firebase/php-jwt": "~3.0||~4.0||~5.0" and only keep compatibility with ^6.0
because older version are not even compatible with PHP 7


"require": {
      "php": ">=5.3.0"
},

https://github.com/firebase/php-jwt/blob/v5.5.1/composer.json

@ysipd26020
Copy link
Author

Hi,

My PHP version is 7.4.x, the version of firebase/php-jwt is the version I'm referring to.

With PHP 7.4 using firebase/php-jwt 6.7.0 with oauth2-azure 2.1.1, I am getting the error due to decoding the JWT
With PHP 7.4 using firebase/php-jwt 6.5.0 with oauth2-azure 2.1.1, I am able to see that the JWT provided by oauth2-azure is decoded by php-jwt.

I would assume that oauth2-azure would need to update its usage of the php-jwt library to support the change introduced in version 6.6.0 and further into 6.7.0

Thanks

@10n
Copy link
Contributor

10n commented Jun 15, 2023

I have createa a pull request, that 3rd argument is not necessary anymore, the variable $keys already is converted to ann array of \Firebase\JWT\Key

#189

@10n
Copy link
Contributor

10n commented Jun 15, 2023

I was also suggesting dropping the compatibility, because that may have been the reason for using the 3rd argument.

@janfejtek
Copy link

it looks like third argument was used only before php-jwt 5.5 https://github.com/firebase/php-jwt/releases/tag/v5.5.0, so removing it breaks the compatibility with older versions anyway

@infabo
Copy link

infabo commented Jul 7, 2023

Could you please release a new version? Thank you

@tomasAl
Copy link

tomasAl commented Jul 12, 2023

Maybe someone knows when the 2.1.2 version will be released? Thank you

@andrewsauder
Copy link

I've submitted a PR to get this fixed. #191

@kojot1234
Copy link
Contributor

@hajekj Would you mind pushing a release out, looks like multiple people are waiting for this. Thanks.

@pps1
Copy link

pps1 commented Jul 24, 2023

@kojot1234 @hajekj Any news on 2.1.2? We too are running into this issue with firebase/php-jwt:6.8.1 and would prefer not version locking at 6.5.0. Thanks for your support!

@casey977
Copy link

casey977 commented Mar 2, 2024

Any news on this?

@kojot1234
Copy link
Contributor

@casey977 If I remember correctly this has been resolved already and issue can be closed.

@casey977
Copy link

casey977 commented Mar 2, 2024

@casey977 If I remember correctly this has been resolved already and issue can be closed.

Well, I'm here because I get the error...

@lyrixx
Copy link

lyrixx commented Mar 2, 2024

@casey977 what version are you using?

@casey977
Copy link

casey977 commented Mar 2, 2024

@casey977 what version are you using?

I use Laravel 10.46.0

@lyrixx
Copy link

lyrixx commented Mar 2, 2024

what version of this lib. You can find it with composer show thenetworg/oauth2-azure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants