Skip to content

Enable Virtual Authenticator for Passkey Automation (WebAuthn via CDP) #4250

@cj36457

Description

@cj36457

Is your feature request related to a problem? Please describe.
Testing passkey/passwordless login flows (via WebAuthn) in automation is currently not supported out of the box in Browser Library. This is a blocker for modern authentication use cases, especially as passkeys become more widely adopted (Chrome, Android, macOS, iOS).
Although Chromium supports virtual authenticators via CDP, Browser Library does not currently expose this.

Describe the solution you'd like
Add a built-in keyword to enable a virtual WebAuthn authenticator for Chromium-based browsers,
e.g.:
Enable Virtual Authenticator [Arguments] ... ${protocol}="ctap2" ... ${transport}="internal" ... ${has_resident_key}=${TRUE} ... ${has_user_verification}=${TRUE} ... ${is_user_verified}=${TRUE} ... ${automatic_presence_simulation}=${TRUE} ... ${is_platform_authenticator}=${TRUE} ... ${timeout}="5s" ... ${log}=${FALSE}

Under the hood, it would call(in Javascript):
client.send('WebAuthn.enable') client.send('WebAuthn.addVirtualAuthenticator', { options })

This could also return an ID for advanced flows like removing the authenticator or switching contexts.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

I’ve built a working solution using a custom JS extension injected via the jsextension= flag:
WebAuthHelper.js
`async function enableWebAuthn(context, page, playwright, logger) {
const client = await context.newCDPSession(page);
await client.send('WebAuthn.enable');

await client.send('WebAuthn.addVirtualAuthenticator', {
options: {
protocol: 'ctap2',
transport: 'internal',
hasResidentKey: true,
hasUserVerification: true,
isUserVerified: true,
automaticPresenceSimulation: true,
},
});

logger("WebAuthn Virtual Authenticator added.");
return "done";
}

exports.__esModule = true;
exports.enableWebAuthn = enableWebAuthn;`

Additional context
Add any other context or screenshots about the feature request here.

  • This functionality only works with Chromium, since it relies on the Chrome DevTools Protocol.
  • I understand that’s a limitation but even with that, many use cases can be unblocked.
  • The feature would mirror existing Connect To Browser With CDP, but with a simpler, test-level abstraction.
  • I’m happy to contribute a PR or help shape the final implementation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions