electron/docs/api
trop[bot] f6ec0dfbff
feat: support WebAuthn Touch ID platform authenticator on macOS (#51412)
* feat: support WebAuthn Touch ID platform authenticator on macOS

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 <sattard@anthropic.com>

* fix: register request delegate as FidoRequestHandlerBase observer

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 <sattard@anthropic.com>

* chore: update copyright attribution for new webauthn files

Co-authored-by: Samuel Attard <sattard@anthropic.com>

* fix: address review feedback on webauthn account-select event

- 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 <sattard@anthropic.com>

* fix: oxfmt formatting in webauthn spec

Co-authored-by: Samuel Attard <sattard@anthropic.com>

* fix: use out-param form of base::Base64UrlEncode

Co-authored-by: Samuel Attard <sattard@anthropic.com>

* fix: silently cancel webauthn account select on unknown credentialId

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 <sattard@anthropic.com>

* chore: node script/lint.js --js --fix

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <sattard@anthropic.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-05-01 11:15:46 -04:00
..
structures feat: support WebAuthn Touch ID platform authenticator on macOS (#51412) 2026-05-01 11:15:46 -04:00
app.md feat: support WebAuthn Touch ID platform authenticator on macOS (#51412) 2026-05-01 11:15:46 -04:00
auto-updater.md feat: msix auto-updater (#49586) 2026-02-02 14:21:40 +01:00
base-window.md docs: note required windows in 'new-window-for-tab' event (#49859) 2026-02-18 20:36:46 -08:00
browser-view.md docs: no class inheritance (#47403) 2025-06-10 10:00:06 +02:00
browser-window.md docs: note required windows in 'new-window-for-tab' event (#49859) 2026-02-18 20:36:46 -08:00
client-request.md docs: fix typos across documentation (#49757) 2026-02-11 16:50:06 +01:00
clipboard.md docs: add more api history (C-D) (#50083) 2026-03-05 17:14:17 +01:00
command-line-switches.md feat: add support for --experimental-transform-types (#49882) 2026-02-25 12:56:35 -05:00
command-line.md chore: lint code blocks in docs with ESLint (#42113) 2025-05-29 12:45:26 -07:00
content-tracing.md feat: support heap profiling in contentTracing (#51178) 2026-04-29 11:29:46 -07:00
context-bridge.md feat: context bridge support VideoFrame (#47316) 2025-08-07 16:41:49 -04:00
cookies.md fix: wrong cause and removed flag in cookie change listener (#49631) 2026-02-03 14:00:30 -05:00
corner-smoothing-css.md docs: fix typos across documentation (#49757) 2026-02-11 16:50:06 +01:00
crash-reporter.md docs: add more api history (C-D) (#50083) 2026-03-05 17:14:17 +01:00
debugger.md docs: remove stale example and standardize DevTools capitalization (#49321) 2026-01-14 10:35:53 +01:00
desktop-capturer.md docs: cleanup desktop-capturer doc after chromium audio capture additions (#50114) 2026-03-06 16:05:26 -05:00
dialog.md docs: add more api history (C-D) (#50083) 2026-03-05 17:14:17 +01:00
dock.md docs: add Menu module tutorials (#47268) 2025-07-15 15:09:32 -07:00
download-item.md chore: lint code blocks in docs with ESLint (#42113) 2025-05-29 12:45:26 -07:00
environment-variables.md feat: msix auto-updater (#49586) 2026-02-02 14:21:40 +01:00
extensions-api.md docs: remove stale example and standardize DevTools capitalization (#49321) 2026-01-14 10:35:53 +01:00
extensions.md docs: unify [!NOTE] structure (#46893) 2025-05-09 14:36:42 -07:00
global-shortcut.md docs: add Menu module tutorials (#47268) 2025-07-15 15:09:32 -07:00
image-view.md docs: no class inheritance (#47403) 2025-06-10 10:00:06 +02:00
in-app-purchase.md docs: transactions-updated event type (#45527) 2025-02-10 10:12:17 -05:00
incoming-message.md docs: fix typos across documentation (#49757) 2026-02-11 16:50:06 +01:00
ipc-main-service-worker.md docs: no class inheritance (#47403) 2025-06-10 10:00:06 +02:00
ipc-main.md docs: Make ipcRenderer and ipcMain listener API docs consistent (#44651) 2024-11-18 14:44:30 -08:00
ipc-renderer.md docs: recommend calling renderer process modules from preload script (#48427) 2025-10-04 18:44:10 +02:00
menu-item.md docs: link menu type references (#50752) 2026-04-06 17:27:35 -04:00
menu.md fix: move Electron help menu links to default app only (#50859) 2026-04-09 15:13:32 -07:00
message-channel-main.md docs: no class inheritance (#47403) 2025-06-10 10:00:06 +02:00
message-port-main.md docs: fix broken links (#36519) 2022-12-05 13:18:57 -05:00
native-image.md docs: explain how to load SF Symbols with nativeImage (#48908) 2025-11-13 10:41:00 -05:00
native-theme.md feat: add accessibilityDisplayShouldDifferentiateWithoutColor on macOS (#50408) 2026-03-25 15:53:31 -04:00
navigation-history.md docs: clarify navigationhistory offsets (#45616) 2025-02-21 17:35:17 -06:00
net-log.md docs: unify [!NOTE] structure (#46893) 2025-05-09 14:36:42 -07:00
net.md chore: lint code blocks in docs with ESLint (#42113) 2025-05-29 12:45:26 -07:00
notification.md feat: support notification priority on Windows (#50382) 2026-03-25 15:49:00 -04:00
parent-port.md docs: fix broken links (#36519) 2022-12-05 13:18:57 -05:00
power-monitor.md docs: fix powerMonitor event types (#45518) 2025-02-10 10:13:11 -05:00
power-save-blocker.md docs: unify [!NOTE] structure (#46893) 2025-05-09 14:36:42 -07:00
process.md docs: fix typos across documentation (#49757) 2026-02-11 16:50:06 +01:00
protocol.md docs: clarify allowed characters in protocol names (#50538) 2026-03-27 09:58:46 -04:00
push-notifications.md fix: APNS token ids are lowercase ASCII (#46101) 2025-03-20 07:57:50 +01:00
safe-storage.md docs: mention kwallet6 command line option (#47427) 2025-06-10 16:12:31 -04:00
screen.md fix: screen.getCursorScreenPoint() crash on Wayland (#50105) 2026-03-08 19:20:34 +01:00
service-worker-main.md docs: fix some module headings (#48177) 2025-08-27 14:52:26 -07:00
service-workers.md chore: lint code blocks in docs with ESLint (#42113) 2025-05-29 12:45:26 -07:00
session.md feat: support WebAuthn Touch ID platform authenticator on macOS (#51412) 2026-05-01 11:15:46 -04:00
share-menu.md docs: add a few API history fragments (#49478) 2026-01-21 13:12:06 -05:00
shared-texture.md chore: use relative links from docs/ to files outside of docs/ (#49866) 2026-02-19 14:23:37 +01:00
shell.md docs: document that shell.trashItem requires backslashes (#49481) 2026-01-21 14:51:12 -05:00
system-preferences.md feat: Add getAccentColor on Linux (#48027) 2025-10-21 14:26:30 -04:00
touch-bar-button.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-color-picker.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-group.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
touch-bar-label.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-other-items-proxy.md docs: unify [!NOTE] structure (#46893) 2025-05-09 14:36:42 -07:00
touch-bar-popover.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-scrubber.md fix: documentation spelling errors (#43366) 2024-08-22 15:44:55 +02:00
touch-bar-segmented-control.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-slider.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-spacer.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar.md docs: no class inheritance (#47403) 2025-06-10 10:00:06 +02:00
tray.md feat: allow macOS tray to maintain position (#47838) 2025-08-07 19:25:50 +02:00
utility-process.md feat: add support for disclaiming utility processes (#49693) 2026-02-11 13:52:14 -08:00
view.md docs: no class inheritance (#47403) 2025-06-10 10:00:06 +02:00
web-contents-view.md docs: no class inheritance (#47403) 2025-06-10 10:00:06 +02:00
web-contents.md docs: add further disposition description (#51369) 2026-04-28 11:14:58 -05:00
web-frame-main.md feat: webFrameMain.fromFrameToken (#47850) 2025-07-31 16:41:44 -04:00
web-frame.md docs: remove stale example and standardize DevTools capitalization (#49321) 2026-01-14 10:35:53 +01:00
web-request.md feat: add excludeUrls and modify urls in WebRequestFilter for better URL filtering (#44692) 2025-02-17 12:40:47 -08:00
web-utils.md docs: recommend calling renderer process modules from preload script (#48427) 2025-10-04 18:44:10 +02:00
webview-tag.md feat: allow defaulting to printer default page size (#49812) 2026-02-19 14:24:30 +01:00
window-open.md fix: restrict window.open features to allowlisted BrowserWindow options (#50948) 2026-04-11 19:04:40 -07:00