Table of Contents

Interface IWebAuthn

Namespace
Selenium.WebDriver.BiDi.Cdp.WebAuthn
Assembly
Selenium.WebDriver.BiDi.Cdp.dll

This domain allows configuring virtual authenticators to test the WebAuthn API.

[Experimental("BIDICDP001")]
public interface IWebAuthn

Properties

CredentialAdded

Triggered when a credential is added to an authenticator.

IEventSource<CredentialAddedEventArgs> CredentialAdded { get; }

Property Value

IEventSource<CredentialAddedEventArgs>

Remarks

Event args (CredentialAddedEventArgs):

  • AuthenticatorId
  • Credential

CredentialAsserted

Triggered when a credential is used in a webauthn assertion.

IEventSource<CredentialAssertedEventArgs> CredentialAsserted { get; }

Property Value

IEventSource<CredentialAssertedEventArgs>

Remarks

Event args (CredentialAssertedEventArgs):

  • AuthenticatorId
  • Credential

CredentialDeleted

Triggered when a credential is deleted, e.g. through PublicKeyCredential.signalUnknownCredential().

IEventSource<CredentialDeletedEventArgs> CredentialDeleted { get; }

Property Value

IEventSource<CredentialDeletedEventArgs>

Remarks

Event args (CredentialDeletedEventArgs):

  • AuthenticatorId
  • CredentialId

CredentialUpdated

Triggered when a credential is updated, e.g. through PublicKeyCredential.signalCurrentUserDetails().

IEventSource<CredentialUpdatedEventArgs> CredentialUpdated { get; }

Property Value

IEventSource<CredentialUpdatedEventArgs>

Remarks

Event args (CredentialUpdatedEventArgs):

  • AuthenticatorId
  • Credential

Methods

AddCredentialAsync(AuthenticatorId, Credential, string?, CancellationToken)

Adds the credential to the specified authenticator.

Task<AddCredentialResult> AddCredentialAsync(AuthenticatorId authenticatorId, Credential credential, string? session = null, CancellationToken cancellationToken = default)

Parameters

authenticatorId AuthenticatorId
credential Credential
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<AddCredentialResult>

A task representing the asynchronous operation, containing a AddCredentialResult.

AddVirtualAuthenticatorAsync(VirtualAuthenticatorOptions, string?, CancellationToken)

Creates and adds a virtual authenticator.

Task<AddVirtualAuthenticatorResult> AddVirtualAuthenticatorAsync(VirtualAuthenticatorOptions options, string? session = null, CancellationToken cancellationToken = default)

Parameters

options VirtualAuthenticatorOptions
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<AddVirtualAuthenticatorResult>

A task representing the asynchronous operation, containing a AddVirtualAuthenticatorResult.

ClearCredentialsAsync(AuthenticatorId, string?, CancellationToken)

Clears all the credentials from the specified device.

Task<ClearCredentialsResult> ClearCredentialsAsync(AuthenticatorId authenticatorId, string? session = null, CancellationToken cancellationToken = default)

Parameters

authenticatorId AuthenticatorId
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<ClearCredentialsResult>

A task representing the asynchronous operation, containing a ClearCredentialsResult.

DisableAsync(string?, CancellationToken)

Disable the WebAuthn domain.

Task<DisableResult> DisableAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<DisableResult>

A task representing the asynchronous operation, containing a DisableResult.

EnableAsync(bool?, string?, CancellationToken)

Enable the WebAuthn domain and start intercepting credential storage and retrieval with a virtual authenticator.

Task<EnableResult> EnableAsync(bool? enableUI = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

enableUI bool?

Whether to enable the WebAuthn user interface. Enabling the UI is recommended for debugging and demo purposes, as it is closer to the real experience. Disabling the UI is recommended for automated testing. Supported at the embedder's discretion if UI is available. Defaults to false.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<EnableResult>

A task representing the asynchronous operation, containing a EnableResult.

GetCredentialAsync(AuthenticatorId, string, string?, CancellationToken)

Returns a single credential stored in the given virtual authenticator that matches the credential ID.

Task<GetCredentialResult> GetCredentialAsync(AuthenticatorId authenticatorId, string credentialId, string? session = null, CancellationToken cancellationToken = default)

Parameters

authenticatorId AuthenticatorId
credentialId string
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetCredentialResult>

A task representing the asynchronous operation, containing a GetCredentialResult.

GetCredentialsAsync(AuthenticatorId, string?, CancellationToken)

Returns all the credentials stored in the given virtual authenticator.

Task<GetCredentialsResult> GetCredentialsAsync(AuthenticatorId authenticatorId, string? session = null, CancellationToken cancellationToken = default)

Parameters

authenticatorId AuthenticatorId
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetCredentialsResult>

A task representing the asynchronous operation, containing a GetCredentialsResult.

RemoveCredentialAsync(AuthenticatorId, string, string?, CancellationToken)

Removes a credential from the authenticator.

Task<RemoveCredentialResult> RemoveCredentialAsync(AuthenticatorId authenticatorId, string credentialId, string? session = null, CancellationToken cancellationToken = default)

Parameters

authenticatorId AuthenticatorId
credentialId string
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<RemoveCredentialResult>

A task representing the asynchronous operation, containing a RemoveCredentialResult.

RemoveVirtualAuthenticatorAsync(AuthenticatorId, string?, CancellationToken)

Removes the given authenticator.

Task<RemoveVirtualAuthenticatorResult> RemoveVirtualAuthenticatorAsync(AuthenticatorId authenticatorId, string? session = null, CancellationToken cancellationToken = default)

Parameters

authenticatorId AuthenticatorId
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<RemoveVirtualAuthenticatorResult>

A task representing the asynchronous operation, containing a RemoveVirtualAuthenticatorResult.

SetAutomaticPresenceSimulationAsync(AuthenticatorId, bool, string?, CancellationToken)

Sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator. The default is true.

Task<SetAutomaticPresenceSimulationResult> SetAutomaticPresenceSimulationAsync(AuthenticatorId authenticatorId, bool enabled, string? session = null, CancellationToken cancellationToken = default)

Parameters

authenticatorId AuthenticatorId
enabled bool
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetAutomaticPresenceSimulationResult>

A task representing the asynchronous operation, containing a SetAutomaticPresenceSimulationResult.

SetCredentialPropertiesAsync(AuthenticatorId, string, bool?, bool?, long?, bool?, double?, string?, CancellationToken)

Task<SetCredentialPropertiesResult> SetCredentialPropertiesAsync(AuthenticatorId authenticatorId, string credentialId, bool? backupEligibility = null, bool? backupState = null, long? activeCmtgKeyIndex = null, bool? generateCmtgKeyOnNextOperation = null, double? signCount = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

authenticatorId AuthenticatorId
credentialId string
backupEligibility bool?
backupState bool?
activeCmtgKeyIndex long?
generateCmtgKeyOnNextOperation bool?
signCount double?

Must be equal to or greater than -1. If -1, the signature counter is removed from the credential, and every assertion operation will report a value of 0. See https://w3c.github.io/webauthn/#signature-counter

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetCredentialPropertiesResult>

A task representing the asynchronous operation, containing a SetCredentialPropertiesResult.

SetResponseOverrideBitsAsync(AuthenticatorId, bool?, bool?, bool?, string?, CancellationToken)

Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present.

Task<SetResponseOverrideBitsResult> SetResponseOverrideBitsAsync(AuthenticatorId authenticatorId, bool? isBogusSignature = null, bool? isBadUV = null, bool? isBadUP = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

authenticatorId AuthenticatorId
isBogusSignature bool?

If isBogusSignature is set, overrides the signature in the authenticator response to be zero. Defaults to false.

isBadUV bool?

If isBadUV is set, overrides the UV bit in the flags in the authenticator response to be zero. Defaults to false.

isBadUP bool?

If isBadUP is set, overrides the UP bit in the flags in the authenticator response to be zero. Defaults to false.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetResponseOverrideBitsResult>

A task representing the asynchronous operation, containing a SetResponseOverrideBitsResult.

SetUserVerifiedAsync(AuthenticatorId, bool, string?, CancellationToken)

Sets whether User Verification succeeds or fails for an authenticator. The default is true.

Task<SetUserVerifiedResult> SetUserVerifiedAsync(AuthenticatorId authenticatorId, bool isUserVerified, string? session = null, CancellationToken cancellationToken = default)

Parameters

authenticatorId AuthenticatorId
isUserVerified bool
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetUserVerifiedResult>

A task representing the asynchronous operation, containing a SetUserVerifiedResult.