-
Notifications
You must be signed in to change notification settings - Fork 276
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
Is jsonwebtoken able to validate Firebase Auth token ? #44
Comments
The private key needs to be in DER format, there are some notes on how to convert PEM -> DER there: https://github.com/Keats/jsonwebtoken/blob/master/tests/notes.md And for decoding you probably want to use the public key, not the private one |
Thanks for your answer :) I read that part and convert my key but I end up with: How can this work ? |
(Hopefully it's not a private key in use you've posted, otherwise you need to change it). DER format is binary, here's an example on how to encode/decode tokens using RSA: https://github.com/Keats/jsonwebtoken/blob/master/tests/rsa.rs#L15-L19 |
No I cropped the key haha. Thanks for your help, I'll try with that
But I cannot run the command you quote in the readme because I don't have the private keys. Later, I read that DER files are just PEM base64 decoded files. So I decoded the base64 above with an online service, copy/paste in a |
Hello,
I try to figure out how to validate a jwt issued by Firebase Auth service.
I try with this code with no chance :
And Claim struct:
The header is correctly parsed but the claim cannot be verified (InvalidSignature). Since I'm new to this, maybe I did something wrong, can someone help me please ?
The text was updated successfully, but these errors were encountered: