Skip to content

feat: expose WebAuthn hybrid transport via 'webauthn-hybrid-request' - #53733

Draft
jsilets wants to merge 1 commit into
electron:mainfrom
jsilets:webauthn-hybrid-qr-event
Draft

jsilets wants to merge 1 commit into
electron:mainfrom
jsilets:webauthn-hybrid-qr-event

Conversation

@jsilets

@jsilets jsilets commented Sep 8, 2026

Copy link
Copy Markdown

Description of Change

Chromium adds the hybrid (caBLE v2, "use a passkey from your phone") transport to every WebAuthn request, but only creates the discovery once the embedder configures a QR generator key in AuthenticatorRequestClientDelegate::ConfigureDiscoveries. Electron never overrode that method, so a navigator.credentials.get() or create() that a site expects to serve over hybrid transport sits forever with no UI and no error. This is the cause of reports like pingdotgg/t3code#5665 (passkey sign-in in an embedded browser hangs) and is the missing piece behind #24573 for cross-device passkeys.

This PR adds the minimal embedder support without pulling any chrome/browser UI into Electron:

  • ElectronAuthenticatorRequestClientDelegate::ConfigureDiscoveries generates the caBLE v2 QR key, encodes it with device::cablev2::qr::Encode, and emits a new session event webauthn-hybrid-request with { relyingPartyId, requestType, qrCode, frame }. The app renders the FIDO:/ string as a QR code.
  • Hybrid discovery is configured (set_cable_data + a storage-partition network context factory) only when a listener received the event. With no listener, behaviour is unchanged.
  • The Bluetooth callbacks passed to RegisterActionCallbacks, previously discarded, are stored. When transport enumeration reports the Bluetooth permission as pending, it is requested so the macOS prompt appears.
  • A second event, webauthn-hybrid-request-completed, fires when the request ends so the app can dismiss the QR code. It is posted from the delegate destructor (how //content signals completion) and resolves the session via the browser context, since the frame is often already gone.
  • Requests are skipped when the UI presentation is not kModal (conditional/autofill and passkey-upgrade requests show no UI in Chromium either), when BLE is unsupported, and on Windows 11 where the OS implements hybrid natively and shows its own QR.

Docs are added to docs/api/session.md; typings are generated from them. Spec tests cover: the event fires for create() and get() with a FIDO:/ payload, a fresh code per request, the completion event, and that requests without a listener still succeed via other authenticators.

Verification status: this was authored without a local Chromium build. All Chromium symbols were checked against the pinned 155.0.8038.2 source. npm run lint:docs passes locally apart from the pr-url placeholder, which I will update with this PR's number. I am relying on CI for compilation and the spec run, and will test the real phone flow on macOS against the CI artifact. Opening as a draft until CI is green.

Known follow-ups (out of scope here): surfacing cablev2::Event::kPhoneConnected so apps can switch from "scan this" to "continue on your phone", and persistent phone pairing (set_cable_pairing_callback).

Checklist

Release Notes

Notes: Added the webauthn-hybrid-request and webauthn-hybrid-request-completed session events so apps can offer WebAuthn hybrid (cross-device, QR code) passkey sign-in.

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Sep 8, 2026
@jsilets
jsilets force-pushed the webauthn-hybrid-qr-event branch from 5379dc4 to bee6f9c Compare September 8, 2026 00:55
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ This PR contains unsigned commits. This repository enforces commit signatures
for all incoming PRs. To get your PR merged, please sign those commits
(git rebase --exec 'git commit -S --amend --no-edit -n' @{upstream}) and force push them to this branch
(git push --force-with-lease)

For more information on signing commits, see GitHub's documentation on Telling Git about your signing key.

@github-actions github-actions Bot added the needs-signed-commits Currently some or all of the commits in this PR are not signed label Sep 8, 2026
Chromium adds the hybrid (caBLE v2) transport to every WebAuthn request,
but only creates the discovery once the embedder configures a QR
generator key in ConfigureDiscoveries. Electron never did, so a request
that a site expected to serve over hybrid transport sat forever with no
UI and no error.

Override ConfigureDiscoveries to generate the key, emit a new session
event 'webauthn-hybrid-request' carrying the FIDO:/ QR payload for the
app to render, and configure the discovery only when a listener accepted
the event. Store the Bluetooth callbacks so the OS permission prompt is
requested once the transport enumeration reports it pending. Emit
'webauthn-hybrid-request-completed' when the request ends so the app can
dismiss its QR code.

Requests with conditional or passkey-upgrade UI presentation are
skipped, as are platforms where Chromium would not create the discovery
(no BLE support, or Windows 11 which implements hybrid natively).

Assisted-By: Claude Fable 5.1, Claude Code
@nearestnabors

Copy link
Copy Markdown

I've run into this issue with mima.social. Tracking.

@adamant-pwn

Copy link
Copy Markdown

Hi @jsilets, thanks for this work. Since this PR has conflicts and unsigned commits, I rebased your commit (authorship kept) onto the security-key PIN change and opened #55427, stacked on #55426. It adds a way to switch to the phone while a PIN-protected key is plugged in, and drops the automatic Bluetooth power-on. Happy to close mine if you'd rather continue here.

This branch has not been deployed

No deployments
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