Skip to content

feat(auth-emulator): Add mock Passkey (WebAuthn) support - #10636

Merged
macastelaz merged 8 commits into
mainfrom
passkey-auth-emulator
Jun 12, 2026
Merged

feat(auth-emulator): Add mock Passkey (WebAuthn) support#10636
macastelaz merged 8 commits into
mainfrom
passkey-auth-emulator

Conversation

@macastelaz

Copy link
Copy Markdown
Contributor

Description

Add support to the auth emulator for the passkey API surface. Passkey support is currently in "private preview" on a feature branch of the firebase web auth SDK (https://github.com/firebase/firebase-js-sdk/tree/passkey) and we are working towards a beta release which will involve updating the auth quickstart that in turn relies on the auth emulator.

Scenarios Tested

Using a locally modified quickstart version with passkey support pointing at a locally running auth emulator with these changes (https://screenshot.googleplex.com/3EbEZapL5Ax8o8h.png) I manually verified:

  • Sign in with passkey
  • Enrolling a passkey
  • Unerolling a passkey
  • Getting passkeys enrolled for a user

@google-cla

google-cla Bot commented Jun 12, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces passkey (WebAuthn) support to the Auth emulator, adding endpoints for starting and finalizing passkey enrollment and sign-in, as well as support for deleting passkeys. It includes corresponding API spec updates, schema definitions, state model enhancements, and a comprehensive test suite in passkey.spec.ts. The review feedback suggests improving WebAuthn compatibility by encoding challenges and user IDs with base64url instead of standard base64, and enforcing global uniqueness of credential IDs during enrollment to prevent duplicate registrations.

Comment thread src/emulator/auth/operations.ts
Comment thread src/emulator/auth/operations.ts
Comment thread src/emulator/auth/operations.ts
macastelaz and others added 3 commits June 11, 2026 20:35
* feat(auth-emulator): Add mock Passkey (WebAuthn) support

* style(auth-emulator): Avoid using 'as any' cast in passkey finalize handlers

* fix(auth-emulator): Resolve strict null check errors on blockingFunctions

* test(auth-emulator): Add integration tests for passkey (WebAuthn) support

* test(auth-emulator): Increase passkey test coverage for edge cases, fallback names, and missing parameters

---------

Co-authored-by: Joe Hanley <joehanley@google.com>
@macastelaz
macastelaz force-pushed the passkey-auth-emulator branch from 852596f to 2e7d6a8 Compare June 12, 2026 01:35
@macastelaz
macastelaz marked this pull request as ready for review June 12, 2026 01:43

@pashanka pashanka left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

Comment thread src/emulator/auth/operations.ts
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

@joehan joehan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format and add a changelog, then this looks good to me

@macastelaz
macastelaz enabled auto-merge (squash) June 12, 2026 20:53
@macastelaz
macastelaz merged commit 882c629 into main Jun 12, 2026
46 of 47 checks passed
@macastelaz
macastelaz deleted the passkey-auth-emulator branch June 12, 2026 21:04
bkendall pushed a commit that referenced this pull request Jul 9, 2026
* feat(auth-emulator): Add mock Passkey (WebAuthn) support (#10609)

* feat(auth-emulator): Add mock Passkey (WebAuthn) support

* style(auth-emulator): Avoid using 'as any' cast in passkey finalize handlers

* fix(auth-emulator): Resolve strict null check errors on blockingFunctions

* test(auth-emulator): Add integration tests for passkey (WebAuthn) support

* test(auth-emulator): Increase passkey test coverage for edge cases, fallback names, and missing parameters

---------

Co-authored-by: Joe Hanley <joehanley@google.com>

* Address PR review comments

* Fix TS conversion error by using assertion function for BlockingFunctionsJwtPayload

* Trigger CLA check

* Do not allow duplicate credentialIds

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* perf(auth-emulator): optimize duplicate credential checks and sign-in lookups

---------

Co-authored-by: Joe Hanley <joehanley@google.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
bkendall pushed a commit that referenced this pull request Jul 9, 2026
* feat(auth-emulator): Add mock Passkey (WebAuthn) support (#10609)

* feat(auth-emulator): Add mock Passkey (WebAuthn) support

* style(auth-emulator): Avoid using 'as any' cast in passkey finalize handlers

* fix(auth-emulator): Resolve strict null check errors on blockingFunctions

* test(auth-emulator): Add integration tests for passkey (WebAuthn) support

* test(auth-emulator): Increase passkey test coverage for edge cases, fallback names, and missing parameters

---------

Co-authored-by: Joe Hanley <joehanley@google.com>

* Address PR review comments

* Fix TS conversion error by using assertion function for BlockingFunctionsJwtPayload

* Trigger CLA check

* Do not allow duplicate credentialIds

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* perf(auth-emulator): optimize duplicate credential checks and sign-in lookups

---------

Co-authored-by: Joe Hanley <joehanley@google.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants