Adding webauth to webdriver capabilities

223 views
Skip to first unread message

David Dick

unread,
Sep 8, 2023, 9:48:36 PM9/8/23
to dev-we...@mozilla.org
Hi all,

Could we add webauthn to the webdriver session capabilities? It would development a little be easier.

Proposed patch attached.

Cheers
Dave
webauthn_capabilities.patch

Henrik Skupin

unread,
Sep 12, 2023, 3:15:41 AM9/12/23
to David Dick, dev-we...@mozilla.org
David Dick wrote on 09.09.23 03:48:

Hi,

> Could we add webauthn to the webdriver session capabilities? It would
> development a little be easier.

Webauthn has already been added to Marionette [1] and geckodriver [2]
but we haven't released a new geckodriver version yet. If you want to
get a sneak peak you could download one of the geckodriver nightly
builds [3] for your platform and let us know if everything works as
expected. FYI right now we do not have an ETA for the next geckodriver
release.

Best,
Henrik

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1846574
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1676679
[3] https://treeherder.mozilla.org/jobs?repo=mozilla-central&searchStr=gd-s


--
Henrik Skupin
Staff Software Engineer
Mozilla Corporation

David Dick

unread,
Sep 12, 2023, 4:06:39 AM9/12/23
to Henrik Skupin, dev-we...@mozilla.org
On 12/9/23 17:15, Henrik Skupin wrote:
Could we add webauthn to the webdriver session capabilities? It would
development a little be easier.
Webauthn has already been added to Marionette [1] and geckodriver [2]
but we haven't released a new geckodriver version yet. If you want to
get a sneak peak you could download one of the geckodriver nightly
builds [3] for your platform and let us know if everything works as
expected. FYI right now we do not have an ETA for the next geckodriver
release.

Hi Henrik,

Thanks for replying.  I've been building firefox from source, and I'm automating it directly by starting firefox with the -marionette flag.

When I open the initial connection to firefox, I currently get the following conversation;

** ~/mozilla-central/obj-x86_64-pc-linux-gnu/dist/bin/firefox -marionette -safe-mode -profile /tmp/firefox_marionette_local_aYhHBixLONc/profile --no-remote --new-instance
<< 50:{"applicationType":"gecko","marionetteProtocol":3}
>> 73:[0,1,"WebDriver:NewSession",{"capabilities":{"requiredCapabilities":{}}}]
<< 679:[1,1,null,{"sessionId":"68621df5-dcc0-45a8-92d0-008645a19662","capabilities":{"browserName":"firefox","browserVersion":"119.0a1","platformName":"linux","acceptInsecureCerts":false,"pageLoadStrategy":"normal","setWindowRect":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"strictFileInteractability":false,"unhandledPromptBehavior":"dismiss and notify","moz:accessibilityChecks":false,"moz:buildID":"20230912083436","moz:headless":false,"moz:platformVersion":"6.4.14-200.fc38.x86_64","moz:processID":404874,"moz:profile":"/tmp/firefox_marionette_local_aYhHBixLONc/profile","moz:shutdownTimeout":60000,"moz:webdriverClick":true,"moz:windowless":false,"proxy":{}}}]
>> 179:[0,2,"WebAuthn:AddVirtualAuthenticator",{"hasResidentKey":true,"hasUserVerification":true,"isUserConsenting":true,"isUserVerified":true,"protocol":"ctap2","transport":"internal"}]

which makes it difficult to know if I can send a WebAuthn:AddVirtualAuthenticator or similar WebAuthn command.  Hence it would be good if I could see webauthn:virtualAuthenticators in the above session capabilities.  The previous patch adds that visibility.  Otherwise all I can do is something horrible like looking to the browserVersion and browserName and guess on that.

Cheers

Dave

Henrik Skupin

unread,
Sep 22, 2023, 4:49:05 AM9/22/23
to David Dick, dev-we...@mozilla.org
David Dick wrote on 12.09.23 10:06:

Hi David,

> 679:[1,1,null,{"sessionId":"68621df5-dcc0-45a8-92d0-008645a19662","capabilities":{"browserName":"firefox","browserVersion":"119.0a1","platformName":"linux","acceptInsecureCerts":false,"pageLoadStrategy":"normal","setWindowRect":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"strictFileInteractability":false,"unhandledPromptBehavior":"dismiss and notify","moz:accessibilityChecks":false,"moz:buildID":"20230912083436","moz:headless":false,"moz:platformVersion":"6.4.14-200.fc38.x86_64","moz:processID":404874,"moz:profile":"/tmp/firefox_marionette_local_aYhHBixLONc/profile","moz:shutdownTimeout":60000,"moz:webdriverClick":true,"moz:windowless":false,"proxy":{}}}]
>

> which makes it difficult to know if I can send a
> WebAuthn:AddVirtualAuthenticator or similar WebAuthn command.  Hence it
> would be good if I could see webauthn:virtualAuthenticators in the above
> session capabilities.  The previous patch adds that visibility. 
> Otherwise all I can do is something horrible like looking to the
> browserVersion and browserName and guess on that.

Sorry for the delay but I finally had the time to check this particular
situation and noticed that you are right. Currently we do not return
this boolean capability, which indeed should be set.

I've filed https://bugzilla.mozilla.org/show_bug.cgi?id=1854568 to get
this fixed. If you want to provide your patch for Marionette I'ld
welcome and be happy to review.

Thanks for pointing that out!

Best,
Reply all
Reply to author
Forward
0 new messages