Closed cindicate443 closed 11 months ago
Hey there!
The tokens returned by this library don't have the same methods as other implementations, for example in lcobucci/jwt
. You can find more information at https://github.com/kreait/firebase-tokens-php#tokens and directly in the interface at https://github.com/kreait/firebase-tokens-php/blob/4.x/src/JWT/Contract/Token.php
If you'd like more than just a headers
and payload
field, you could re-parse the JWT with another library, for example (because you have it in your composer.json) with lcobucci/jwt
https://lcobucci-jwt.readthedocs.io/en/stable/parsing-tokens/
I hope this helps!
@jeromegamez Thank you, that makes much more sense. I was able to resolve the issue using the lcobucci/jwt library. Thanks! :)
Glad I could help! 🌺
Describe the bug
Hello, I'm trying to get the uid from the verified Firebase token, but I'm unable to use the 'getClaims('sub')' method. I'm using the same exact code under the 'Verify an ID token' heading, just adding the token from Firebase, but when I add '$token->getClaims('sub')' to try get retrieve the uid, I get the error below. I'm fairly new to implementing libraries and I'm just unsure how to retrieve the sub-claim. Also, I'm not using Firebase Admin SDK as my backend.
Please help, thanks!
Installed packages
PHP version and extensions
Steps to reproduce the issue.
Error message/Stack trace
Additional information
No response