WebAuthnApi class Null safety

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


WebAuthnApi(Client _client)


hashCode int
The hash code for this object.
onCredentialAdded Stream<CredentialAddedEvent>
Triggered when a credential is added to an authenticator.
onCredentialAsserted Stream<CredentialAssertedEvent>
Triggered when a credential is used in a webauthn assertion.
runtimeType Type
A representation of the runtime type of the object.


addCredential(AuthenticatorId authenticatorId, Credential credential) Future<void>
Adds the credential to the specified authenticator.
addVirtualAuthenticator(VirtualAuthenticatorOptions options) Future<AuthenticatorId>
Creates and adds a virtual authenticator.
clearCredentials(AuthenticatorId authenticatorId) Future<void>
Clears all the credentials from the specified device.
disable() Future<void>
Disable the WebAuthn domain.
enable({bool? enableUI}) Future<void>
Enable the WebAuthn domain and start intercepting credential storage and retrieval with a virtual authenticator. enableUI 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.
getCredential(AuthenticatorId authenticatorId, String credentialId) Future<Credential>
Returns a single credential stored in the given virtual authenticator that matches the credential ID.
getCredentials(AuthenticatorId authenticatorId) Future<List<Credential>>
Returns all the credentials stored in the given virtual authenticator.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
removeCredential(AuthenticatorId authenticatorId, String credentialId) Future<void>
Removes a credential from the authenticator.
removeVirtualAuthenticator(AuthenticatorId authenticatorId) Future<void>
Removes the given authenticator.
setAutomaticPresenceSimulation(AuthenticatorId authenticatorId, bool enabled) Future<void>
Sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator. The default is true.
setResponseOverrideBits(AuthenticatorId authenticatorId, {bool? isBogusSignature, bool? isBadUV, bool? isBadUP}) Future<void>
Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present. isBogusSignature If isBogusSignature is set, overrides the signature in the authenticator response to be zero. Defaults to false. isBadUV If isBadUV is set, overrides the UV bit in the flags in the authenticator response to be zero. Defaults to false. isBadUP If isBadUP is set, overrides the UP bit in the flags in the authenticator response to be zero. Defaults to false.
setUserVerified(AuthenticatorId authenticatorId, bool isUserVerified) Future<void>
Sets whether User Verification succeeds or fails for an authenticator. The default is true.
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.