Skip to content

[🐛 Bug]: Virtual authenticator commands doesn't follow webdriver protocol correctly #11967

@TomerDavid-Transmit

Description

@TomerDavid-Transmit

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

8.26.3

Node.js Version

18.12.1

Mode

WDIO Testrunner

Which capabilities are you using?

No response

What happened?

Hi there,

I'm using the virtual authenticator methods under the browser object and had several issues with them.
1.addVirtualAuthenicator says it's the return value is void it actually returns a string (for authenticatorId, as it should).
2. setUserVerified does not require the isUserVerified parameter and asks for credentialId instead. I've searched for the actual command and it doesn't seem to follow the protocol
3. getCredentials says it's the return value is void it actually returns a list of credentials
4. addCredential should require authenticatorId but it doesn't, causing the method to throw. Also treats the largeBlob param as mandatory but it's supposed to be optional.
Credential and virtual authenticator removals works fine.

While searching wdio lib code, I found a dependency called devtools-protocol that has the correct interfaces. Although it's a CDP command resource, and we're talking about webdriver commands, I think the interfaces should be aligned.

If there's an option to send raw webdriver protocol commands plz lmk because I could send them myself until this issue is resolved.

What is your expected behavior?

No response

How to reproduce the bug.

just install wdio and try to use these methods

Relevant log output

`addCredential` example:
[0-0] 2024-01-08T09:17:03.926Z INFO webdriver: Retrying 3/3
[0-0] 2024-01-08T09:17:03.926Z INFO webdriver: [POST] http://0.0.0.0:52957/session/e9edc93edc67354dfaa0d5f34b364d55/webauthn/authenticator/:authenticatorId/credential
[0-0] 2024-01-08T09:17:03.926Z INFO webdriver: DATA {
[0-0]   credentialId: 'JDHdmkzaqXpeEfB6I4TupZN8AUGTTXVFqqPBeMG84O8',
[0-0]   isResidentCredential: true,
[0-0]   rpId: 'api.userid-dev.io',
[0-0]   privateKey: 'MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDOWaIWhmhtcMpB4-S5VGhUWlK_lLSdIAy2_0vbENVfa2kENKYJ3Kq9D2vtmUP8PZaHENS_R57H27KUO4SX0B4uhsqDVQ_sBVrVXxWredmYUuenHIgTfwgHLiHpkDu5lAkVZDaeFCc8xTPb2UetwNE9I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BgCTdk5_5ii_CXuw58d2f6pORo9ZSGeRPLgIGFGDoII42e2oizpPx6BSAkKyBmcrMhf36kmosgpUb9nv5FTivVrXkLq-0S2nz6s35T7VYItnjBqLH8Tp-3_d5PXVF5FXiMYFlbXorwmixqWcxqypIw6EGjMq262jFuXuMDIA5zRWBAoGASk4lj0dsOM43Nst_-RITPQXpoSDsUxOiAEtVvf6xWaByf7DsDIeQgwf6CxUdeTMGaqryW9fCFaLQA50waA8QTEA0vZ3bPy5T96IofvmUvFxi0_N7PmdY58XFxPNUVHiaTvEOmkDDEbnaO8Nvg3batsYiQRUppIrfSStvbnZqekE',
[0-0]   userHandle: 'NjljMTQ5MWUtODE2ZS00Y2I2LWIyOGUtZWZkMjUzZWIzNjcz',
[0-0]   signCount: 1,
[0-0]   largeBlob: 'e30='
[0-0] }
[0-0] 2024-01-08T09:17:03.929Z ERROR webdriver: Request failed with status 400 due to invalid argument: invalid argument: Could not find a Virtual Authenticator matching the ID
[0-0]   (Session info: chrome=120.0.6099.109)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🐛good first picka reasonable task to start getting familiar with the code basehelp wantedIssues that are free to take by anyone interested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions