kriasoft / kriasoft/web-auth-library
Firebase Emulator doesn't sign idToken, trips web-auth-library up
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 117
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
I'm using the Firebase Authentication Emulator, and kept getting this error locally from my CloudFlare Worker:
[FetchError: Public key "undefined" not found.]
After digging through the code a while and manually using jose to decode the idToken header (where the "undefined" comes from), I discovered that there is no kid on the locally generated idToken - more info here https://github.com/firebase/firebase-tools/issues/2764
I could workaround this by using jose directly when in emulator mode, but it would be ideal if I could provide an 'emulator' flag in the options and the library would simply skip the signing check? A note about the emulator in the readme would also help future users.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the idToken verification path used by the Cloudflare Worker and inspect how the missing Firebase Emulator kid produces the public-key error. Compare the requested emulator option with the existing verification behavior, then update the README so emulator limitations and the resulting supported behavior are clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- firebase, typescript
- Domain
- authentication, cloud, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100