WebAuthn Domain
This domain allows configuring virtual authenticators to test the WebAuthn API.
Methods
- WebAuthn.addCredential
- WebAuthn.addVirtualAuthenticator
- WebAuthn.clearCredentials
- WebAuthn.disable
- WebAuthn.enable
- WebAuthn.getCredential
- WebAuthn.getCredentials
- WebAuthn.removeCredential
- WebAuthn.removeVirtualAuthenticator
- WebAuthn.setAutomaticPresenceSimulation
- WebAuthn.setCredentialProperties
- WebAuthn.setResponseOverrideBits
- WebAuthn.setUserVerified
Events
- WebAuthn.credentialAdded
- WebAuthn.credentialAsserted
- WebAuthn.credentialDeleted
- WebAuthn.credentialUpdated
Types
Methods
WebAuthn.addCredential #
Adds the credential to the specified authenticator.
Parameters
authenticatorId credential WebAuthn.addVirtualAuthenticator #
Creates and adds a virtual authenticator.
Parameters
options Return object
authenticatorId WebAuthn.clearCredentials #
Clears all the credentials from the specified device.
Parameters
authenticatorId WebAuthn.enable #
Enable the WebAuthn domain and start intercepting credential storage and retrieval with a virtual authenticator.
Parameters
enableUIOptional
booleanWhether 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.
WebAuthn.getCredential #
Returns a single credential stored in the given virtual authenticator that matches the credential ID.
Parameters
authenticatorId credentialId stringReturn object
credential WebAuthn.getCredentials #
Returns all the credentials stored in the given virtual authenticator.
Parameters
authenticatorId Return object
credentials array[ Credential ]WebAuthn.removeCredential #
Removes a credential from the authenticator.
Parameters
authenticatorId credentialId stringWebAuthn.setAutomaticPresenceSimulation #
Sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator. The default is true.
Parameters
authenticatorId enabled booleanWebAuthn.setCredentialProperties #
Allows setting credential properties. https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties
Parameters
authenticatorId credentialId stringbackupEligibilityOptional
booleanbackupStateOptional
booleanWebAuthn.setResponseOverrideBits #
Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present.
Parameters
authenticatorId isBogusSignatureOptional
booleanIf isBogusSignature is set, overrides the signature in the authenticator response to be zero. Defaults to false.
isBadUVOptional
booleanIf isBadUV is set, overrides the UV bit in the flags in the authenticator response to be zero. Defaults to false.
isBadUPOptional
booleanIf isBadUP is set, overrides the UP bit in the flags in the authenticator response to be zero. Defaults to false.
WebAuthn.setUserVerified #
Sets whether User Verification succeeds or fails for an authenticator. The default is true.
Parameters
authenticatorId isUserVerified booleanEvents
WebAuthn.credentialAdded #
Triggered when a credential is added to an authenticator.
Parameters
authenticatorId credential WebAuthn.credentialAsserted #
Triggered when a credential is used in a webauthn assertion.
Parameters
authenticatorId credential WebAuthn.credentialDeleted #
Triggered when a credential is deleted, e.g. through PublicKeyCredential.signalUnknownCredential().
Parameters
authenticatorId credentialId stringWebAuthn.credentialUpdated #
Triggered when a credential is updated, e.g. through PublicKeyCredential.signalCurrentUserDetails().
Parameters
authenticatorId credential Types
WebAuthn.Credential #
Type: object
Properties
credentialId stringisResidentCredential booleanrpIdOptional
stringRelying Party ID the credential is scoped to. Must be set when adding a credential.
privateKey stringThe ECDSA P-256 private key in PKCS#8 format. (Encoded as a base64 string when passed over JSON)
userHandleOptional
stringAn opaque byte sequence with a maximum size of 64 bytes mapping the credential to a specific user. (Encoded as a base64 string when passed over JSON)
signCount integerSignature counter. This is incremented by one for each successful assertion. See https://w3c.github.io/webauthn/#signature-counter
largeBlobOptional
stringThe large blob associated with the credential. See https://w3c.github.io/webauthn/#sctn-large-blob-extension (Encoded as a base64 string when passed over JSON)
backupEligibilityOptional
booleanAssertions returned by this credential will have the backup eligibility (BE) flag set to this value. Defaults to the authenticator's defaultBackupEligibility value.
backupStateOptional
booleanAssertions returned by this credential will have the backup state (BS) flag set to this value. Defaults to the authenticator's defaultBackupState value.
userNameOptional
stringThe credential's user.name property. Equivalent to empty if not set. https://w3c.github.io/webauthn/#dom-publickeycredentialentity-name
userDisplayNameOptional
stringThe credential's user.displayName property. Equivalent to empty if not set. https://w3c.github.io/webauthn/#dom-publickeycredentialuserentity-displayname
WebAuthn.VirtualAuthenticatorOptions #
Type: object
Properties
protocol ctap2VersionOptional
Defaults to ctap2_0. Ignored if |protocol| == u2f.
transport hasResidentKeyOptional
booleanDefaults to false.
hasUserVerificationOptional
booleanDefaults to false.
hasLargeBlobOptional
booleanIf set to true, the authenticator will support the largeBlob extension. https://w3c.github.io/webauthn#largeBlob Defaults to false.
hasCredBlobOptional
booleanIf set to true, the authenticator will support the credBlob extension. https://fidoalliance.org/specs/fido-v2.1-rd-20201208/fido-client-to-authenticator-protocol-v2.1-rd-20201208.html#sctn-credBlob-extension Defaults to false.
hasMinPinLengthOptional
booleanIf set to true, the authenticator will support the minPinLength extension. https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-minpinlength-extension Defaults to false.
hasPrfOptional
booleanIf set to true, the authenticator will support the prf extension. https://w3c.github.io/webauthn/#prf-extension Defaults to false.
automaticPresenceSimulationOptional
booleanIf set to true, tests of user presence will succeed immediately. Otherwise, they will not be resolved. Defaults to true.
isUserVerifiedOptional
booleanSets whether User Verification succeeds or fails for an authenticator. Defaults to false.
defaultBackupEligibilityOptional
booleanCredentials created by this authenticator will have the backup eligibility (BE) flag set to this value. Defaults to false. https://w3c.github.io/webauthn/#sctn-credential-backup
defaultBackupStateOptional
booleanCredentials created by this authenticator will have the backup state (BS) flag set to this value. Defaults to false. https://w3c.github.io/webauthn/#sctn-credential-backup