Repository navigation
Conversation
Adds `app.configureWebAuthn({ touchID: { keychainAccessGroup } })` to enable
the Secure Enclave platform authenticator for `navigator.credentials`.
Credentials are stored under the app-supplied keychain access group with a
per-session metadata secret that is generated on first use and persisted in
prefs.
Also introduces `ElectronAuthenticatorRequestClientDelegate` and wires it via
`ContentBrowserClient::GetWebAuthenticationRequestDelegate()` so that
discoverable-credential `get()` calls with multiple matches emit a new
`select-webauthn-account` session event instead of DCHECK-failing in the base
delegate. If no listener is registered (or the callback is invoked with no
credential), the request is cancelled with NotAllowedError rather than
silently auto-selecting.
Tests use the DevTools virtual authenticator so the account-selection flow is
exercised in CI without entitlements or real hardware.
Co-authored-by: Samuel Attard <[email protected]>
The base AuthenticatorRequestClientDelegate::StartObserving() is a no-op, so observer() on the request handler stayed null. MakeCredentialRequestHandler:: SpecializeRequestForAuthenticator dereferences observer()->SupportsPIN() when residentKey is 'preferred', crashing with SEGV when a real FIDO2 HID key is dispatched. Override StartObserving/StopObserving to register via a ScopedObservation like ChromeAuthenticatorRequestDelegate does. Added a virtual-authenticator regression test for create() with residentKey: 'preferred'. Co-authored-by: Samuel Attard <[email protected]>
Co-authored-by: Samuel Attard <[email protected]>
- Encode credentialId and userHandle as URL-safe base64 without padding so the values match PublicKeyCredential.id from navigator.credentials.get() byte-for-byte; tests now assert the equality rather than transcoding. - Cancel the pending request when the listener invokes the callback with a credentialId that does not match any account, instead of leaving the request hanging while the listener retries. The TypeError still surfaces so the misuse remains visible to the developer. - DCHECK that the Touch ID config helpers run on the UI thread, encoding the threading invariant the read-then-write metadata-secret pref relies on. Co-authored-by: Samuel Attard <[email protected]>
Co-authored-by: Samuel Attard <[email protected]>
Co-authored-by: Samuel Attard <[email protected]>
Throwing back into the listener bubbles up as an unhandled exception in the main process. Match the no-args branch exactly so the listener sees a single consistent failure mode (cancel + NotAllowedError) whether it declines deliberately or by mistake. Co-authored-by: Samuel Attard <[email protected]>
5 tasks done
MarshallOfSound
approved these changes
May 1, 2026
Member
|
Backport approved by @electron/wg-releases in #wg-releases-backport-requests. |
jkleinsc
approved these changes
May 1, 2026
|
Release Notes Persisted
|
jkleinsc
deleted the
trop/42-x-y-bp-feat-support-webauthn-touch-id-platform-authenticator-on-macos-1777567211264
branch
May 1, 2026 15:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #51255
See that PR for details.
Notes: Added
app.configureWebAuthn()to enable the Touch ID platform authenticator for WebAuthn on macOS, and aselect-webauthn-accountsession event for choosing between multiple discoverable credentials.