Skip to content

Add support for creating and removing virtual authenticators#7760

Merged
shs96c merged 6 commits intoSeleniumHQ:masterfrom
nsatragno:master
Nov 29, 2019
Merged

Add support for creating and removing virtual authenticators#7760
shs96c merged 6 commits intoSeleniumHQ:masterfrom
nsatragno:master

Conversation

@nsatragno
Copy link
Copy Markdown
Contributor

This patch adds support for the Virtual Authenticators WebDriver API,
allowing developers to write E2E tests that exercise the WebAuthn API.
At the moment, the API is only supported on Chrome 79 onwards.

Fixes #7753

  • [ X ] By placing an X in the preceding checkbox, I verify that I have signed the Contributor License Agreement -- Google already has a CLA on file with Selenium.

@nsatragno
Copy link
Copy Markdown
Contributor Author

This is ready to review @barancev

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Nov 23, 2019

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Member

@shs96c shs96c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thank you so much for this. It looks great! Thank you also for the nudge on the Slack channel :) I've been heads-down at work, so that was genuinely helpful.

I've added a few comments, and how we proceed is up to you. If you have the time and energy, I'd really appreciate you responding to them (particularly the one about moving the marker interface to the one class that implements it right now) If not, please let me know, and I'll land this when I have some space to address the points myself.

Comment thread java/client/src/org/openqa/selenium/remote/RemoteWebDriver.java
public class VirtualAuthenticatorOptions {

enum Protocol {
CTAP2("ctap2"), U2F("ctap1/u2f");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: one per line, please.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@shs96c shs96c added the C-java Java Bindings label Nov 28, 2019
Copy link
Copy Markdown
Contributor Author

@nsatragno nsatragno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review, rebased and addressed comments below:

Another thing I changed is instead of defining the test as a java_test_suite, I used +java_selenium_test_suite with browsers = ["chrome", "edge", "ie", "safari"], so we can run this in other browsers as they support it.

Comment thread java/client/src/org/openqa/selenium/remote/RemoteWebDriver.java
public class VirtualAuthenticatorOptions {

enum Protocol {
CTAP2("ctap2"), U2F("ctap1/u2f");
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@nsatragno
Copy link
Copy Markdown
Contributor Author

If you have the time and energy, I'd really appreciate you responding to them (particularly the one about moving the marker interface to the one class that implements it right now) If not, please let me know, and I'll land this when I have some space to address the points myself.

Oh I'll be happy to take care of the comments and I'm planning a follow up to add the implementation for the other methods, too. I didn't want my first patch to the project to be too big though :)

@shs96c
Copy link
Copy Markdown
Member

shs96c commented Nov 29, 2019

Thank you very much for the cleanups. This is great. Merging with pleasure and joy! Thank you!

@shs96c shs96c merged commit 4c568fe into SeleniumHQ:master Nov 29, 2019
@barancev
Copy link
Copy Markdown
Member

I want to note that a marker interface requires a driver to return a special capability. Should we report an issue to chromedriver to add a new read-only capability?

@nsatragno
Copy link
Copy Markdown
Contributor Author

Agreed, filed a bug in the spec.

@equalsJeffH
Copy link
Copy Markdown

@nsatragno

Agreed, filed a bug in the spec.

Ok, so w3c/webauthn#1351 and w3c/webauthn#1353 are wrt webauthn spec. How will the chromedriver implementers (and also those of other webdriver impls) learn about the new extension capability buried in the webauthn spec? Is there a canonical registry of WebDriver extensions that we can add VirtualAuthenticators to ?

@nsatragno
Copy link
Copy Markdown
Contributor Author

How will the chromedriver implementers (and also those of other webdriver impls) learn about the new extension capability buried in the webauthn spec?

Presumably those implementing the WebAuthn WebDriver API would read it from the webauthn spec since that's where the API is defined in the first place. Since the capability is defined as an extension capability, matching it is optional for webdriver implementers [1], so it shouldn't be a problem if they don't. Not matching it would mean it's not supported, which is the correct behaviour.

At least that's my understanding of the spec, it's very possible I got something wrong! :)

[1] https://w3c.github.io/webdriver/#dfn-matching-capabilities step 2.

@equalsJeffH
Copy link
Copy Markdown

that all makes sense. I'm just begging the question of how WebDriver implementors become aware of various webdriver extensions, including webauthn's. I suppose advertising it on [email protected] is one way to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-java Java Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support the WebAuthn Automation API

5 participants