Closed richmondgingingon closed 2 years ago
When the clock in the environment your app is running lags behind (as the message suggests) you can add a leeway parameter to the verifyIdToken
method: https://firebase-php.readthedocs.io/en/stable/authentication.html#verify-a-firebase-id-token
On another note: you already signed in a user with email and password, that means the authentication has already been done and you don't have to verify the ID Token again, and you can get the Firebase UID of the user with $signinResult->firebaseUserId()
(https://firebase-php.readthedocs.io/en/stable/authentication.html#custom-authentication-flows)
I see, I fixed it. Server time was 8 hours in the past. Thanks for the info.
I'm trying to create website using Laravel Framework with Firebase Admin SDK. I'm stuck with verifying user's token when trying to log in.
I'm getting this message
The value 'eyJhbGciOiJSUzI...' is not a verified ID token: - The token was issued in the future
I have set my laravel datetimezone to my timezone which is
Asia/Kuala_Lumpur
onAppServiceProvider
,ENV
,config/app.php
and the time is working as expected but the problem still occurred.Here is my login function
Sometimes it can logged in properly, and sometimes it doesn't. I have to send this command
php artisan cache:clear
and it will work again.