Passkeys in environment-hosted (server) browser tabs #16944
Follow-up to #16370 (passkeys in desktop browser tabs on macOS).
Problem. Tabs the environment server hosts in its own headless browser, which remote servers, the web app, and mobile all use, have no way to complete a WebAuthn ceremony. A page that calls navigator.credentials.get or create there never reaches an authenticator. The headless shell has no UI, and the user's authenticator is on the client (Touch ID, iCloud Keychain, a phone, a security key), not on the server.
Direction. Bridge the ceremony to the viewing client, like the desktop bridge in #16370, but across the network:
- In the server tab, intercept
navigator.credentials.*(CDPWebAuthndomain or an init script), and send the request with the page's committed origin, taken from the server, never the page, to the client that controls the tab. - The client runs the ceremony with its own platform API: WebAuthn on the web, AuthenticationServices on desktop macOS, Credential Manager / ASAuthorization on mobile. It returns the credential, and the server resolves the page's promise.
- Hard parts:
- RP ID and origin: the client's own origin differs from the page's, so browsers won't let a web client assert for an arbitrary RP ID. This probably needs the native apps; a plain web client can't.
- Security: only the controlling viewer may answer, and the same origin and subframe rules as #16370 apply.
Scope. Desktop macOS first, since it reuses #16370's AuthenticationServices path once Apple grants com.apple.developer.web-browser.public-key-credential. Then mobile. The plain web client is likely not possible.
An idea offered by GPT 6.1 Sol Xhigh:
I hit this on Windows with a WSL environment (
0.0.46-nightly.20261015.3176). Microsoft sign-in hangs in T3’s server browser without opening a security dialog. The same YubiKey worked in normal WSL Chrome.For these checks, the key was attached to WSL through
usbipd.fido2-token -I /dev/hidraw0succeeds, and T3’s Chromium process belongs toplugdev. I haven’t traced the exact failure inside the headless browser.There is existing Windows code to investigate: T3’s desktop app depends on
@clerk/electron-passkeys, pinned to 0.0.3. Its Windows helper calls the native WebAuthn API, but needs changes before serving arbitrary websites:- It constructs the signing origin from the RP ID. A page at
https://login.example.comusing RP IDexample.comwould get the wrong origin. - Its public API exposes no cancellation method.
For existing-key sign-in, I propose this API:
export function prepareWindowsAssertion( windowHandle: Buffer, optionsJson: string, origin: string, ): { get(): Promise<string>; cancel(): void; };The Windows client would trust the connected T3 environment for the committed page origin, then check that the RP ID belongs to that origin before signing. The implementation also needs WebAuthn’s prescribed client-data serialization, bounded cancellation handling, and one native operation at a time until it finishes.
For this approach, the YubiKey would remain attached to Windows while the browser and login session remain in WSL. It needs a rebuilt Windows addon and T3’s request forwarding. I haven’t tested a working Windows forwarding implementation.
- It constructs the signing origin from the RP ID. A page at
Correction: this reproduction belongs with #14398, not here. I misidentified the browser. These agent-opened tabs, including a hidden incognito tab the desktop never displayed, are drawn by the desktop's Electron webview, not the server's headless shell:
- WebGL renderer:
ANGLE (Apple, ANGLE Metal Renderer: Apple M3 Max), not SwiftShader. - The
Electron/44.4.5user agent is genuine.
I've moved the corrected reproduction to #14398. Sorry for the noise.
- WebGL renderer:
Sign in to join this conversation.
One option for credentials that live on the host rather than the viewing device, like a password manager's stored passkeys: Chrome's DevTools
WebAuthndomain (addVirtualAuthenticator+addCredential). Because the authenticator sits next to the page, the origin/RP ID problem goes away. We use it locally, outside T3's code, for server tabs, and it signs in on real sites. Gotchas that matter for any design here:WebAuthn.disable) wipes it, even one that never touched WebAuthn. T3 opens and detaches a session per panel viewer, so the authenticator has to be watched and re-added.navigator.credentials.get()started beforeWebAuthn.enablenever settles (headless ignores the page's timeout). Only a reload or navigation releases it.signCount: -1makes every assertion report 0, matching password managers that don't count. SetbackupEligibility/backupStateto match how the passkey was registered.WebAuthn.credentialAsserted).Request for #17762: please keep the fallback where pages use Chromium's own WebAuthn when no passkey-capable viewer holds control, so an authenticator added through CDP keeps working.