Table of Contents

Class WebAuthnAdapter

Namespace
OpenQA.Selenium.DevTools.V146.WebAuthn
Assembly
Selenium.WebDriver.dll

Represents an adapter for the WebAuthn domain to simplify the command interface.

public class WebAuthnAdapter
Inheritance
WebAuthnAdapter
Inherited Members

Constructors

WebAuthnAdapter(IDevToolsSession)

Initializes a new instance of the WebAuthnAdapter class.

public WebAuthnAdapter(IDevToolsSession session)

Parameters

session IDevToolsSession

The IDevToolsSession to be used with this adapter.

Exceptions

ArgumentNullException

If session is null.

Properties

Session

Gets the DevToolsSession associated with the adapter.

public IDevToolsSession Session { get; }

Property Value

IDevToolsSession

Methods

AddCredential(AddCredentialCommandSettings, CancellationToken, int?, bool)

Adds the credential to the specified authenticator.

public Task<AddCredentialCommandResponse?> AddCredential(AddCredentialCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command AddCredentialCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<AddCredentialCommandResponse>

AddVirtualAuthenticator(AddVirtualAuthenticatorCommandSettings, CancellationToken, int?, bool)

Creates and adds a virtual authenticator.

public Task<AddVirtualAuthenticatorCommandResponse> AddVirtualAuthenticator(AddVirtualAuthenticatorCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command AddVirtualAuthenticatorCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<AddVirtualAuthenticatorCommandResponse>

ClearCredentials(ClearCredentialsCommandSettings, CancellationToken, int?, bool)

Clears all the credentials from the specified device.

public Task<ClearCredentialsCommandResponse?> ClearCredentials(ClearCredentialsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ClearCredentialsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ClearCredentialsCommandResponse>

Disable(DisableCommandSettings?, CancellationToken, int?, bool)

Disable the WebAuthn domain.

public Task<DisableCommandResponse?> Disable(DisableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command DisableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<DisableCommandResponse>

Enable(EnableCommandSettings, CancellationToken, int?, bool)

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

public Task<EnableCommandResponse?> Enable(EnableCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command EnableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<EnableCommandResponse>

GetCredential(GetCredentialCommandSettings, CancellationToken, int?, bool)

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

public Task<GetCredentialCommandResponse> GetCredential(GetCredentialCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetCredentialCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetCredentialCommandResponse>

GetCredentials(GetCredentialsCommandSettings, CancellationToken, int?, bool)

Returns all the credentials stored in the given virtual authenticator.

public Task<GetCredentialsCommandResponse> GetCredentials(GetCredentialsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetCredentialsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetCredentialsCommandResponse>

RemoveCredential(RemoveCredentialCommandSettings, CancellationToken, int?, bool)

Removes a credential from the authenticator.

public Task<RemoveCredentialCommandResponse?> RemoveCredential(RemoveCredentialCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command RemoveCredentialCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<RemoveCredentialCommandResponse>

RemoveVirtualAuthenticator(RemoveVirtualAuthenticatorCommandSettings, CancellationToken, int?, bool)

Removes the given authenticator.

public Task<RemoveVirtualAuthenticatorCommandResponse?> RemoveVirtualAuthenticator(RemoveVirtualAuthenticatorCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command RemoveVirtualAuthenticatorCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<RemoveVirtualAuthenticatorCommandResponse>

SetAutomaticPresenceSimulation(SetAutomaticPresenceSimulationCommandSettings, CancellationToken, int?, bool)

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

public Task<SetAutomaticPresenceSimulationCommandResponse?> SetAutomaticPresenceSimulation(SetAutomaticPresenceSimulationCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetAutomaticPresenceSimulationCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetAutomaticPresenceSimulationCommandResponse>

SetCredentialProperties(SetCredentialPropertiesCommandSettings, CancellationToken, int?, bool)

public Task<SetCredentialPropertiesCommandResponse?> SetCredentialProperties(SetCredentialPropertiesCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetCredentialPropertiesCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetCredentialPropertiesCommandResponse>

SetResponseOverrideBits(SetResponseOverrideBitsCommandSettings, CancellationToken, int?, bool)

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

public Task<SetResponseOverrideBitsCommandResponse?> SetResponseOverrideBits(SetResponseOverrideBitsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetResponseOverrideBitsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetResponseOverrideBitsCommandResponse>

SetUserVerified(SetUserVerifiedCommandSettings, CancellationToken, int?, bool)

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

public Task<SetUserVerifiedCommandResponse?> SetUserVerified(SetUserVerifiedCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetUserVerifiedCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetUserVerifiedCommandResponse>

Events

CredentialAdded

Triggered when a credential is added to an authenticator.

public event EventHandler<CredentialAddedEventArgs>? CredentialAdded

Event Type

EventHandler<CredentialAddedEventArgs>

CredentialAsserted

Triggered when a credential is used in a webauthn assertion.

public event EventHandler<CredentialAssertedEventArgs>? CredentialAsserted

Event Type

EventHandler<CredentialAssertedEventArgs>

CredentialDeleted

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

public event EventHandler<CredentialDeletedEventArgs>? CredentialDeleted

Event Type

EventHandler<CredentialDeletedEventArgs>

CredentialUpdated

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

public event EventHandler<CredentialUpdatedEventArgs>? CredentialUpdated

Event Type

EventHandler<CredentialUpdatedEventArgs>