Kreait Firebase verifyIdToken works only with APP_ENV=prod #47138
Unanswered
Guillaume35
asked this question in
Q&A
Replies: 1 comment
-
Can you create a reproducer ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm trying to make a firebase token verification on my Symfony application. I'm using Kreait\Firebase library for that with the following :
composer require kreait/firebase-bundle
I follow firebase-php documentation in order to control the token sent by the client with the following :
$verifiedIdToken = $this->auth->verifyIdToken($identifier);
I know that verifyIdToken() function needs to request https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com in order to get current google keys for firebase.
In my .env file, when
APP_ENV=prod
, everything works fine. But wenAPP_ENV=dev
, I get this error :[critical] Uncaught PHP Exception Kreait\Firebase\Exception\Auth\FailedToVerifyToken: "The inner handler of Kreait\Firebase\JWT\Action\FetchGooglePublicKeys\WithPsr6Cache (Kreait\Firebase\JWT\Action\FetchGooglePublicKeys\WithGuzzle) failed in fetching keys: The connection to https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com failed: Unable to read from stream" at /home/guillaume/git/pebble-authenticator/vendor/kreait/firebase-php/src/Firebase/Auth.php line 381
I wasn't able to find this error on firebase or symfony documentation.
It is as if the security system is not allowing to goes throw https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com in dev mode.
If someone has an idea to make it works in dev mode, it would be so nice !
Guillaume.
Beta Was this translation helpful? Give feedback.
All reactions