-
Notifications
You must be signed in to change notification settings - Fork 142
Help with integration with Firebase token #184
Comments
Hello @leossmith did you make this work? I'm with the same difficulty to do this! |
Yes I managed to make it work. It seems like the issue was the secrets I used. I was splitting the keys I got from google to arrays, but this is already done by JwtAuthentication. So the final working code is this:
|
@leossmith thank you so much for this help! I will see if it works with me too! Thanks again! |
@gregorispielmann no worries. If you have any issues it should probably be an issue with the CorsMiddleware, which has to be setted up properly for X-Authorization. |
@leossmith, I changed now with your comment. My Cors middleware is that now: $app->add(new \Bairwell\MiddlewareCors([
'origin' => ['*'],
'exposeHeaders' => '',
'maxAge' => 120,
'allowCredentials' => true,
'allowMethods' => ['GET', 'POST', 'OPTIONS'],
'allowHeaders' => ['Accept', 'Accept-Language', 'X-Authorization' ,'Authorization', 'Content-Type','DNT','Keep-Alive','User-Agent','X-Requested-With','If-Modified-Since','Cache-Control','Origin'],
])); I'm forgetting something? Thanks again!!! |
I am not sure if it the above works. This is what i use:
|
I'm trying to use your solution to verify the idToken passed from the firebase auth in my chrome extension but without success. Do you used the |
This is part of my midleware which is initiated in my index.php . I am using Slim 4. |
I've figured out how to implement my own middleware after some tests and headache. The mai problem was to figure out what is the correct token to use as bearer. Firebase javascript sdk provides two different tokens. The first one is returned is the
This token will be not valid if passed to the middleware. The correct way to get the working token is by calling the |
I have used this in the past to authenticate using my own JWT, but now i want to use the Firebase token for users. I have tried multiple things, without any luck. This is my code:
But it keeps going to 401 not authorized. Do you have an example using Firebase Auth for authentication?
Thank you.
Using Php Slim 4
The text was updated successfully, but these errors were encountered: