WebAuthn

class WebAuthn(cdp: CDP) : Domain

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

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard
@Serializable
data class AddCredentialParameter(val authenticatorId: String, val credential: WebAuthn.Credential)
Link copied to clipboard
Link copied to clipboard
@Serializable
data class AddVirtualAuthenticatorReturn(val authenticatorId: String)
Link copied to clipboard
Link copied to clipboard
@Serializable
data class ClearCredentialsParameter(val authenticatorId: String)
Link copied to clipboard
@Serializable
data class Credential(val credentialId: String, val isResidentCredential: Boolean, val rpId: String? = null, val privateKey: String, val userHandle: String? = null, val signCount: Int, val largeBlob: String? = null, val backupEligibility: Boolean? = null, val backupState: Boolean? = null, val userName: String? = null, val userDisplayName: String? = null)
Link copied to clipboard
@Serializable
data class CredentialAddedParameter(val authenticatorId: String, val credential: WebAuthn.Credential)

Triggered when a credential is added to an authenticator.

Link copied to clipboard
@Serializable
data class CredentialAssertedParameter(val authenticatorId: String, val credential: WebAuthn.Credential)

Triggered when a credential is used in a webauthn assertion.

Link copied to clipboard
@Serializable
data class CredentialDeletedParameter(val authenticatorId: String, val credentialId: String)

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

Link copied to clipboard
@Serializable
data class CredentialUpdatedParameter(val authenticatorId: String, val credential: WebAuthn.Credential)

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

Link copied to clipboard
Link copied to clipboard
@Serializable
data class EnableParameter(val enableUI: Boolean? = null)
Link copied to clipboard
@Serializable
data class GetCredentialParameter(val authenticatorId: String, val credentialId: String)
Link copied to clipboard
@Serializable
data class GetCredentialReturn(val credential: WebAuthn.Credential)
Link copied to clipboard
@Serializable
data class GetCredentialsParameter(val authenticatorId: String)
Link copied to clipboard
@Serializable
data class GetCredentialsReturn(val credentials: List<WebAuthn.Credential>)
Link copied to clipboard
@Serializable
data class RemoveCredentialParameter(val authenticatorId: String, val credentialId: String)
Link copied to clipboard
@Serializable
data class RemoveVirtualAuthenticatorParameter(val authenticatorId: String)
Link copied to clipboard
@Serializable
data class SetAutomaticPresenceSimulationParameter(val authenticatorId: String, val enabled: Boolean)
Link copied to clipboard
@Serializable
data class SetCredentialPropertiesParameter(val authenticatorId: String, val credentialId: String, val backupEligibility: Boolean? = null, val backupState: Boolean? = null)
Link copied to clipboard
@Serializable
data class SetResponseOverrideBitsParameter(val authenticatorId: String, val isBogusSignature: Boolean? = null, val isBadUV: Boolean? = null, val isBadUP: Boolean? = null)
Link copied to clipboard
@Serializable
data class SetUserVerifiedParameter(val authenticatorId: String, val isUserVerified: Boolean)
Link copied to clipboard
@Serializable
data class VirtualAuthenticatorOptions(val protocol: WebAuthn.AuthenticatorProtocol, val ctap2Version: WebAuthn.Ctap2Version? = null, val transport: WebAuthn.AuthenticatorTransport, val hasResidentKey: Boolean? = null, val hasUserVerification: Boolean? = null, val hasLargeBlob: Boolean? = null, val hasCredBlob: Boolean? = null, val hasMinPinLength: Boolean? = null, val hasPrf: Boolean? = null, val automaticPresenceSimulation: Boolean? = null, val isUserVerified: Boolean? = null, val defaultBackupEligibility: Boolean? = null, val defaultBackupState: Boolean? = null)

Properties

Link copied to clipboard

Triggered when a credential is added to an authenticator.

Link copied to clipboard

Triggered when a credential is used in a webauthn assertion.

Link copied to clipboard

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

Link copied to clipboard

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

Functions

Link copied to clipboard
suspend fun addCredential(args: WebAuthn.AddCredentialParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun addCredential(authenticatorId: String, credential: WebAuthn.Credential)

Adds the credential to the specified authenticator.

Link copied to clipboard
suspend fun clearCredentials(authenticatorId: String)
suspend fun clearCredentials(args: WebAuthn.ClearCredentialsParameter, mode: CommandMode = CommandMode.DEFAULT)

Clears all the credentials from the specified device.

Link copied to clipboard
suspend fun disable(mode: CommandMode = CommandMode.DEFAULT)

Disable the WebAuthn domain.

Link copied to clipboard
suspend fun enable(enableUI: Boolean? = null)
suspend fun enable(args: WebAuthn.EnableParameter, mode: CommandMode = CommandMode.DEFAULT)

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

Link copied to clipboard
suspend fun getCredential(authenticatorId: String, credentialId: String): WebAuthn.GetCredentialReturn

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

Link copied to clipboard
suspend fun getCredentials(authenticatorId: String): WebAuthn.GetCredentialsReturn

Returns all the credentials stored in the given virtual authenticator.

Link copied to clipboard
suspend fun removeCredential(args: WebAuthn.RemoveCredentialParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun removeCredential(authenticatorId: String, credentialId: String)

Removes a credential from the authenticator.

Link copied to clipboard
suspend fun removeVirtualAuthenticator(authenticatorId: String)

Removes the given authenticator.

Link copied to clipboard
suspend fun setAutomaticPresenceSimulation(authenticatorId: String, enabled: Boolean)

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

Link copied to clipboard
suspend fun setCredentialProperties(args: WebAuthn.SetCredentialPropertiesParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun setCredentialProperties(authenticatorId: String, credentialId: String, backupEligibility: Boolean? = null, backupState: Boolean? = null)

Allows setting credential properties. https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties

Link copied to clipboard
suspend fun setResponseOverrideBits(args: WebAuthn.SetResponseOverrideBitsParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun setResponseOverrideBits(authenticatorId: String, isBogusSignature: Boolean? = null, isBadUV: Boolean? = null, isBadUP: Boolean? = null)

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

Link copied to clipboard
suspend fun setUserVerified(args: WebAuthn.SetUserVerifiedParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun setUserVerified(authenticatorId: String, isUserVerified: Boolean)

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