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
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
enableUI
Optional
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
credentialId
string
Return 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
string
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
enabled
boolean
WebAuthn.setCredentialProperties #
Allows setting credential properties. https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties
Parameters
authenticatorId
credentialId
string
backupEligibility
Optional
boolean
backupState
Optional
boolean
WebAuthn.setResponseOverrideBits #
Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present.
Parameters
authenticatorId
isBogusSignature
Optional
boolean
If isBogusSignature is set, overrides the signature in the authenticator response to be zero. Defaults to false.
isBadUV
Optional
boolean
If isBadUV is set, overrides the UV bit in the flags in the authenticator response to be zero. Defaults to false.
isBadUP
Optional
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
isUserVerified
boolean
Events
Types
WebAuthn.Credential #
Type: object
Properties
credentialId
string
isResidentCredential
boolean
rpId
Optional
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
Optional
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
Optional
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
Optional
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
Optional
boolean
Assertions returned by this credential will have the backup state (BS) flag set to this value. Defaults to the authenticator's defaultBackupState value.
WebAuthn.VirtualAuthenticatorOptions #
Type: object
Properties
protocol
ctap2Version
Optional
Defaults to ctap2_0. Ignored if |protocol| == u2f.
transport
hasResidentKey
Optional
boolean
Defaults to false.
hasUserVerification
Optional
boolean
Defaults to false.
hasLargeBlob
Optional
boolean
If set to true, the authenticator will support the largeBlob extension. https://w3c.github.io/webauthn#largeBlob Defaults to false.
hasCredBlob
Optional
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
Optional
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
Optional
boolean
If set to true, the authenticator will support the prf extension. https://w3c.github.io/webauthn/#prf-extension Defaults to false.
automaticPresenceSimulation
Optional
boolean
If set to true, tests of user presence will succeed immediately. Otherwise, they will not be resolved. Defaults to true.
isUserVerified
Optional
boolean
Sets whether User Verification succeeds or fails for an authenticator. Defaults to false.
defaultBackupEligibility
Optional
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
Optional
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