WebAuthnDomain

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

Official doc

Functions

Link copied to clipboard
suspend fun addCredential(authenticatorId: AuthenticatorId, credential: Credential): AddCredentialResponse

Adds the credential to the specified authenticator.

Link copied to clipboard

Clears all the credentials from the specified device.

Link copied to clipboard
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
suspend fun disable(): DisableResponse

Disable the WebAuthn domain.

Link copied to clipboard
inline suspend fun enable(optionalArgs: EnableRequest.Builder.() -> Unit = {}): EnableResponse
suspend fun enable(input: EnableRequest): EnableResponse

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

Link copied to clipboard
fun events(): Flow<WebAuthnEvent>

Subscribes to all events related to this domain.

Link copied to clipboard
suspend fun getCredential(authenticatorId: AuthenticatorId, credentialId: String): GetCredentialResponse

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

Link copied to clipboard

Returns all the credentials stored in the given virtual authenticator.

Link copied to clipboard
suspend fun removeCredential(authenticatorId: AuthenticatorId, credentialId: String): RemoveCredentialResponse

Removes a credential from the authenticator.

Link copied to clipboard

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

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

Link copied to clipboard

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

Link copied to clipboard
suspend fun setUserVerified(authenticatorId: AuthenticatorId, isUserVerified: Boolean): SetUserVerifiedResponse

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