feat(auth-emulator): Add mock Passkey (WebAuthn) support - #10636
Conversation
|
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. |
There was a problem hiding this comment.
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.
6e28476 to
852596f
Compare
* 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>
852596f to
2e7d6a8
Compare
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
joehan
left a comment
There was a problem hiding this comment.
Format and add a changelog, then this looks good to me
* 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>
* 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>
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: