Rayrun
← Back to Discord Forum

Configure Virtual Webauthn Authenticators in WebKit

kevinflanaganposted in #help-playwright
Open in Discord
kevinflanagan
kevinflanagan

Hi folks,

I've been using playwright to automate testing of a webauthn application which requires enabling the browser's virtual authenticator support. With Chromium this is really easy to do you just open a CDPSession and send the commands to configure the virtual authenticator:

const devTools = await page.context().newCDPSession(page);
  await devTools.send('WebAuthn.enable');
  await devTools.send('WebAuthn.addVirtualAuthenticator', {
    options: {
      protocol: 'ctap2',
      transport: 'internal',
      hasUserVerification: true,
      isUserVerified: true,
      hasResidentKey: true,
    },
  });

This naturally does not work for Webkit browsers. According to the Webkit and Webauthn spec Webkit should be capable of utilizing virtual authenticators. Webkit supports the webdriver extension command for webauthn(https://www.w3.org/TR/webauthn-3/#sctn-automation-add-virtual-authenticator). Talking with devs on the Webkit side they also mentioned that when using WebDriver you need to specify enabling the extension command (https://www.w3.org/TR/webauthn-3/#sctn-automation-webdriver-capability).

Given that playwright is based on a websocket protocol and not webdriver I'm not sure of how I could go about enabling and configuring virtual authenticator support for Webkit in a playwright context. The Chrome DevTools Protocol seems to be pretty much identical to these extension commands so I'm hopeful that there may be a potential solution.

If anyone has thoughts or has managed to test webauthn applications with Playwright, it would be much appreciated.

This thread is trying to answer question "How can I enable and configure virtual Webauthn authenticator support for WebKit in a Playwright context?"

2 replies
passenger_mac

Bumping this back up to start the week. Any guideance would be much appreciated!

File on issue on github, your best best is to get help from playwright devs.

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.