WebAuthn Domain
This domain allows configuring virtual authenticators to test the WebAuthn API.
Methods
Events
Types
Methods
WebAuthn.addCredential #
Adds the credential to the specified authenticator.
parameters
- authenticatorId
-
AuthenticatorId
- credential
-
Credential
WebAuthn.addVirtualAuthenticator #
Creates and adds a virtual authenticator.
parameters
- options
-
VirtualAuthenticatorOptions
Return Object
- authenticatorId
-
AuthenticatorId
WebAuthn.clearCredentials #
Clears all the credentials from the specified device.
parameters
- authenticatorId
-
AuthenticatorId
WebAuthn.disable #
Disable the WebAuthn domain.
WebAuthn.enable #
Enable the WebAuthn domain and start intercepting credential storage and retrieval with a virtual authenticator.
parameters
- enableUI
-
boolean
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.
WebAuthn.getCredential #
Returns a single credential stored in the given virtual authenticator that matches the credential ID.
parameters
- authenticatorId
-
AuthenticatorId
- credentialId
-
string
Return Object
- credential
-
Credential
WebAuthn.getCredentials #
Returns all the credentials stored in the given virtual authenticator.
parameters
- authenticatorId
-
AuthenticatorId
Return Object
- credentials
-
array[ Credential ]
WebAuthn.removeCredential #
Removes a credential from the authenticator.
parameters
- authenticatorId
-
AuthenticatorId
- credentialId
-
string
WebAuthn.removeVirtualAuthenticator #
Removes the given authenticator.
parameters
- authenticatorId
-
AuthenticatorId
WebAuthn.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
-
AuthenticatorId
- enabled
-
boolean
WebAuthn.setCredentialProperties #
Allows setting credential properties. https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties
parameters
- authenticatorId
-
AuthenticatorId
- credentialId
-
string
- backupEligibility
-
boolean
- backupState
-
boolean
WebAuthn.setResponseOverrideBits #
Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present.
parameters
- authenticatorId
-
AuthenticatorId
- isBogusSignature
-
boolean
If isBogusSignature is set, overrides the signature in the authenticator response to be zero. Defaults to false.
- isBadUV
-
boolean
If isBadUV is set, overrides the UV bit in the flags in the authenticator response to be zero. Defaults to false.
- isBadUP
-
boolean
If 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
-
AuthenticatorId
- isUserVerified
-
boolean
Events
WebAuthn.credentialAdded #
Triggered when a credential is added to an authenticator.
parameters
- authenticatorId
-
AuthenticatorId
- credential
-
Credential
WebAuthn.credentialAsserted #
Triggered when a credential is used in a webauthn assertion.
parameters
- authenticatorId
-
AuthenticatorId
- credential
-
Credential
WebAuthn.credentialDeleted #
Triggered when a credential is deleted, e.g. through PublicKeyCredential.signalUnknownCredential().
parameters
- authenticatorId
-
AuthenticatorId
- credentialId
-
string
WebAuthn.credentialUpdated #
Triggered when a credential is updated, e.g. through PublicKeyCredential.signalCurrentUserDetails().
parameters
- authenticatorId
-
AuthenticatorId
- credential
-
Credential
Types
WebAuthn.Credential #
Type: object
properties
- credentialId
-
string
- isResidentCredential
-
boolean
- rpId
-
string
Relying Party ID the credential is scoped to. Must be set when adding a credential.
- privateKey
-
string
The ECDSA P-256 private key in PKCS#8 format. (Encoded as a base64 string when passed over JSON)
- userHandle
-
string
An 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
-
integer
Signature counter. This is incremented by one for each successful assertion. See https://w3c.github.io/webauthn/#signature-counter
- largeBlob
-
string
The 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)
- backupEligibility
-
boolean
Assertions returned by this credential will have the backup eligibility (BE) flag set to this value. Defaults to the authenticator's defaultBackupEligibility value.
- backupState
-
boolean
Assertions returned by this credential will have the backup state (BS) flag set to this value. Defaults to the authenticator's defaultBackupState value.
- userName
-
string
The credential's user.name property. Equivalent to empty if not set. https://w3c.github.io/webauthn/#dom-publickeycredentialentity-name
- userDisplayName
-
string
The 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
-
AuthenticatorProtocol
- ctap2Version
-
Ctap2Version
Defaults to ctap2_0. Ignored if |protocol| == u2f.
- transport
-
AuthenticatorTransport
- hasResidentKey
-
boolean
Defaults to false.
- hasUserVerification
-
boolean
Defaults to false.
- hasLargeBlob
-
boolean
If set to true, the authenticator will support the largeBlob extension. https://w3c.github.io/webauthn#largeBlob Defaults to false.
- hasCredBlob
-
boolean
If 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.
- hasMinPinLength
-
boolean
If 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.
- hasPrf
-
boolean
If set to true, the authenticator will support the prf extension. https://w3c.github.io/webauthn/#prf-extension Defaults to false.
- automaticPresenceSimulation
-
boolean
If set to true, tests of user presence will succeed immediately. Otherwise, they will not be resolved. Defaults to true.
- isUserVerified
-
boolean
Sets whether User Verification succeeds or fails for an authenticator. Defaults to false.
- defaultBackupEligibility
-
boolean
Credentials 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
- defaultBackupState
-
boolean
Credentials 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