Repository navigation
Conversation
5379dc4 to
bee6f9c
Compare
|
For more information on signing commits, see GitHub's documentation on Telling Git about your signing key. |
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
bee6f9c to
304c8ef
Compare
|
I've run into this issue with mima.social. Tracking. |
|
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. |
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 anavigator.credentials.get()orcreate()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/browserUI into Electron:ElectronAuthenticatorRequestClientDelegate::ConfigureDiscoveriesgenerates the caBLE v2 QR key, encodes it withdevice::cablev2::qr::Encode, and emits a new session eventwebauthn-hybrid-requestwith{ relyingPartyId, requestType, qrCode, frame }. The app renders theFIDO:/string as a QR code.set_cable_data+ a storage-partition network context factory) only when a listener received the event. With no listener, behaviour is unchanged.RegisterActionCallbacks, previously discarded, are stored. When transport enumeration reports the Bluetooth permission as pending, it is requested so the macOS prompt appears.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.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 forcreate()andget()with aFIDO:/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.2source.npm run lint:docspasses locally apart from thepr-urlplaceholder, 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::kPhoneConnectedso apps can switch from "scan this" to "continue on your phone", and persistent phone pairing (set_cable_pairing_callback).Checklist
npm testpassesRelease Notes
Notes: Added the
webauthn-hybrid-requestandwebauthn-hybrid-request-completedsession events so apps can offer WebAuthn hybrid (cross-device, QR code) passkey sign-in.