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

Google Auth - wrong number of segments #145

Open
epapada opened this issue Feb 15, 2024 · 2 comments
Open

Google Auth - wrong number of segments #145

epapada opened this issue Feb 15, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@epapada
Copy link

epapada commented Feb 15, 2024

Hello, we are trying to use graphql-authentication with Google and we are keep getting this error
UnexpectedValueException: Wrong number of segments in /var/www/html/vendor/firebase/php-jwt/src/JWT.php:112
We've noticed there that the id token that Google returns, cannot get verified because it doesn't have the correct format
$tks = \explode('.', $jwt); if (\count($tks) !== 3) { throw new UnexpectedValueException('Wrong number of segments'); } list($headb64, $bodyb64, $cryptob64) = $tks;

The token google returns only has two dots, and therefore less than three segments when exploded, so it always fails verification. We also tried to bypass this, only for other issues to appear later on the code. So are not sure where the issue lies. We do not have a redirect url, not sure if that is an issue though. We are using this on a nuxt project, with no success so far. Any help towards the correct direction will be greatly appreciated.

Thanks
Evangelos

@jamesedmonston jamesedmonston self-assigned this May 16, 2024
@jamesedmonston
Copy link
Owner

Did you ever get this sorted?

I just tested with my development OAuth project and it all worked okay.

@epapada
Copy link
Author

epapada commented Aug 27, 2024

Hi James! thanks for the update. We haven't tried again to be honest. We are going to give it another try and update this issue.

Cheers
Evangelos

@jamesedmonston jamesedmonston added the bug Something isn't working label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants