-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jwt.verify() always evaluates as false for Google-issued JWT when using certificate verification #46
Comments
Update - the error seems to be:
I've tried lots of other JWT validation libraries, but none of them run on Cloudflare Workers due to missing crypto library dependencies. Hoping there is a solution with |
Hey @johnswarbrick, thanks for bringing this to my attention and providing data to test with, really appreciated. Will take a look and let you know once I've implemented a fix :) |
Hey @johnswarbrick, The WebCrypto API doesn't currently support importing X.509 keys, supporting this would require a bit more work, and since I want to keep this library lightweight, I don't really want to ship all of that code just to support this scenario. I hope you can understand :) If you're looking for a heavier, but more feature-full implementation of JWT, check out panva/jose |
Thanks @tsndr, that's a shame as I like your very lightweight library, but I completely understand your decision! Really appreciate you looking into this so quickly. |
If you really want to keep using this library you could Parse the X509 certificate on your end and just pass the resulting public key to |
Hi -
Using
@tsndr/[email protected]
I always getfalse
when trying to verify a Google-issued JWT with a certificate.This is basically the same issue as #28 logged by @Zombobot1
I'm using JWTs and certificates issued by Google firebase. The certificates are provided here:
https://www.googleapis.com/robot/v1/metadata/x509/[email protected]
I'm extracting the kid from the JWT and using that to match with the specific certificate that should be used to validate the JWT.
I tried using the raw certificate as supplied by Google, tried removing the
-----BEGIN CERTIFICATE-----
prefix/suffix and tried removing line feeds but it always verifies as false.Rather than supplying my own JWT/certificate I've re-used those from the previously raised ticket.
Would really appreciate some help with this one!
The text was updated successfully, but these errors were encountered: