google-api-php-client icon indicating copy to clipboard operation
google-api-php-client copied to clipboard

How to verifyIdToken with credential return from google

Open dieptang opened this issue 2 years ago • 1 comments

Hello there,

I am using Google Gsi for Google login with the callback resonsding client_id, credential, select_by. I sent it to the PHP server and using JWT for decode it but not help.

This is the code: $decode = JWT::decode($credential, $key, array('HS256'));

which $key is getting from Google Console "Client Secret" when create the credentials right?

I also give it a try with $client->verifyIdToken($credential); but it;s also not works. The error always appear is "Wrong number of segments"

Please help me solve it.

dieptang avatar Feb 25 '23 04:02 dieptang

For now I know the decode with JWT successfully. But I cannot verifyToken. Can anybody help ?

dieptang avatar Feb 25 '23 07:02 dieptang