kriasoft / kriasoft/web-auth-library

Firebase Emulator doesn't sign idToken, trips web-auth-library up

Open
#27 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.