Importing firebase PEM as x509 throws "Supplied format is not supported" on Fastly Compute #820
Unanswered
cupofjoakim
asked this question in
Q&A
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to verify some firebase session tokens in our Fastly Compute edge, but I'm unable to even import the x509 certificate.
The public keys are gotten from here: https://www.googleapis.com/identitytoolkit/v3/relyingparty/publicKeys
Running
await jose.importX509(certificate, 'RS256');throws us this error:The JWT header reports RS256 as algo and
kIMSOwas the kid. At the time of writing, that kid corresponds to this public key:I'm unsure what this barks up to – afaik it could be weirdness with googles certificates, an issue with the fastly compute runtime, a legit bug in the jose package.
@panva has kindly given an example for the same functionality in this comment, and that was reported as working a year ago, so I'm inclined to suspect Fastly here. That is further supported as the import seems to work in node 22 when running a test in vitest:
Fastly does claim to support at least v5 in the docs: https://www.fastly.com/documentation/guides/compute/developer-guides/javascript/#using-dependencies
I'll reach out to our contacts at fastly as well, but thought it'd make sense to make a discussion here if it was something known.
Beta Was this translation helpful? Give feedback.
All reactions