Class WebAuthnAdapter
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
sessionIDevToolsSessionThe IDevToolsSession to be used with this adapter.
Exceptions
- ArgumentNullException
If
sessionis null.
Properties
Session
Gets the DevToolsSession associated with the adapter.
public IDevToolsSession Session { get; }
Property Value
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
commandAddCredentialCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandAddVirtualAuthenticatorCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandClearCredentialsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandDisableCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandEnableCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetCredentialCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandGetCredentialsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandRemoveCredentialCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandRemoveVirtualAuthenticatorCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetAutomaticPresenceSimulationCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetCredentialProperties(SetCredentialPropertiesCommandSettings, CancellationToken, int?, bool)
Allows setting credential properties. https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties
public Task<SetCredentialPropertiesCommandResponse?> SetCredentialProperties(SetCredentialPropertiesCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetCredentialPropertiesCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetResponseOverrideBitsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetUserVerifiedCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
Events
CredentialAdded
Triggered when a credential is added to an authenticator.
public event EventHandler<CredentialAddedEventArgs>? CredentialAdded
Event Type
CredentialAsserted
Triggered when a credential is used in a webauthn assertion.
public event EventHandler<CredentialAssertedEventArgs>? CredentialAsserted
Event Type
CredentialDeleted
Triggered when a credential is deleted, e.g. through PublicKeyCredential.signalUnknownCredential().
public event EventHandler<CredentialDeletedEventArgs>? CredentialDeleted
Event Type
CredentialUpdated
Triggered when a credential is updated, e.g. through PublicKeyCredential.signalCurrentUserDetails().
public event EventHandler<CredentialUpdatedEventArgs>? CredentialUpdated