跳到主要内容

WebAuthn🧪

该域允许配置虚拟认证器以测试WebAuthn API。

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

✅️️ Methods

🔨WebAuthn.addCredential

将凭据添加到指定的认证器中。

EN
Adds the credential to the specified authenticator.
参数必填标记类型描述原文
authenticatorId✔️AuthenticatorId
credential✔️Credential

🔨WebAuthn.addVirtualAuthenticator

创建并添加一个虚拟认证器。

EN
Creates and adds a virtual authenticator.
参数必填标记类型描述原文
options✔️VirtualAuthenticatorOptions
返回对象类型描述原文
authenticatorIdAuthenticatorId

🔨WebAuthn.clearCredentials

清除指定设备中的所有凭据。

EN
Clears all the credentials from the specified device.
参数必填标记类型描述原文
authenticatorId✔️AuthenticatorId

🔨WebAuthn.disable

禁用 WebAuthn 域。

EN
Disable the WebAuthn domain.

🔨WebAuthn.enable

启用 WebAuthn 域,并通过虚拟认证器开始拦截凭据的存储与检索。

EN
Enable the WebAuthn domain and start intercepting credential storage and retrieval with a virtual authenticator.
参数必填标记类型描述原文
enableUIboolean是否启用WebAuthn用户界面。建议在调试和演示时启用此界面,因为它更接近真实体验。建议在自动化测试时禁用此界面。是否支持取决于嵌入器是否提供UI界面。默认值为false。
ENWhether 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

返回存储在指定虚拟认证器中与凭证ID匹配的单个凭证。

EN
Returns a single credential stored in the given virtual authenticator that matches the credential ID.
参数必填标记类型描述原文
authenticatorId✔️AuthenticatorId
credentialId✔️string
返回对象类型描述原文
credentialCredential

🔨WebAuthn.getCredentials

返回存储在给定虚拟认证器中的所有凭据。

EN
Returns all the credentials stored in the given virtual authenticator.
参数必填标记类型描述原文
authenticatorId✔️AuthenticatorId
返回对象类型描述原文
credentialsarray[Credential]

🔨WebAuthn.removeCredential

从认证器中移除一个凭证。

EN
Removes a credential from the authenticator.
参数必填标记类型描述原文
authenticatorId✔️AuthenticatorId
credentialId✔️string

🔨WebAuthn.removeVirtualAuthenticator

移除给定的身份验证器。

EN
Removes the given authenticator.
参数必填标记类型描述原文
authenticatorId✔️AuthenticatorId

🔨WebAuthn.setAutomaticPresenceSimulation

设置用户存在性测试是否将立即成功(如果为真)或无法解析(如果为假)对于认证器。默认值为真。

EN
Sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator. The default is true.
参数必填标记类型描述原文
authenticatorId✔️AuthenticatorId
enabled✔️boolean

🔨WebAuthn.setCredentialProperties

允许设置凭据属性。https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties

EN
参数必填标记类型描述原文
authenticatorId✔️AuthenticatorId
credentialId✔️string
backupEligibilityboolean
backupStateboolean

🔨WebAuthn.setResponseOverrideBits

如果参数 isBogusSignature、isBadUV、isBadUP 不存在,则将其重置为 false。

EN
Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present.
参数必填标记类型描述原文
authenticatorId✔️AuthenticatorId
isBogusSignatureboolean如果设置了isBogusSignature,会将认证器响应中的签名覆盖为零。默认为false。
ENIf isBogusSignature is set, overrides the signature in the authenticator response to be zero. Defaults to false.
isBadUVboolean如果isBadUV被设置,会覆盖认证器响应中标志位的UV位,将其置为零。默认为false。
ENIf isBadUV is set, overrides the UV bit in the flags in the authenticator response to be zero. Defaults to false.
isBadUPboolean如果设置了isBadUP,会将认证器响应中标志位的UP位覆盖为零。默认为false。
ENIf isBadUP is set, overrides the UP bit in the flags in the authenticator response to be zero. Defaults to false.

🔨WebAuthn.setUserVerified

设置认证器的用户验证是否成功。默认值为 true。

EN
Sets whether User Verification succeeds or fails for an authenticator. The default is true.
参数必填标记类型描述原文
authenticatorId✔️AuthenticatorId
isUserVerified✔️boolean

✅️️ Events

👋WebAuthn.credentialAdded

当凭据被添加到认证器时触发。

EN
Triggered when a credential is added to an authenticator.
参数必填标记类型描述原文
authenticatorId✔️AuthenticatorId
credential✔️Credential

👋WebAuthn.credentialAsserted

当凭据在 WebAuthn 断言中被使用时触发。

EN
Triggered when a credential is used in a webauthn assertion.
参数必填标记类型描述原文
authenticatorId✔️AuthenticatorId
credential✔️Credential

👋WebAuthn.credentialDeleted

当凭证被删除时触发,例如通过 PublicKeyCredential.signalUnknownCredential() 方法。

EN
Triggered when a credential is deleted, e.g. through PublicKeyCredential.signalUnknownCredential().
参数必填标记类型描述原文
authenticatorId✔️AuthenticatorId
credentialId✔️string

👋WebAuthn.credentialUpdated

当凭证被更新时触发,例如通过 PublicKeyCredential.signalCurrentUserDetails() 方法。

EN
Triggered when a credential is updated, e.g. through PublicKeyCredential.signalCurrentUserDetails().
参数必填标记类型描述原文
authenticatorId✔️AuthenticatorId
credential✔️Credential

✅️️ Types

📌WebAuthn.AuthenticatorId

返回类型:string


📌WebAuthn.AuthenticatorProtocol

允许的值:u2fctap2

EN
Allowed Values: u2f, ctap2

返回类型:string


📌WebAuthn.AuthenticatorTransport

允许的值:usbnfcblecableinternal

EN
Allowed Values: usb, nfc, ble, cable, internal

返回类型:string


📌WebAuthn.Credential

返回类型:object

属性必填标记类型描述原文
credentialId✔️string
isResidentCredential✔️boolean
rpIdstring凭证所关联的依赖方ID。在添加凭证时必须设置此参数。
ENRelying Party ID the credential is scoped to. Must be set when adding a credential.
privateKey✔️stringECDSA P-256 私钥,采用 PKCS#8 格式。(通过 JSON 传递时,编码为 base64 字符串)
ENThe ECDSA P-256 private key in PKCS#8 format. (Encoded as a base64 string when passed over JSON)
userHandlestring一个不透明的字节序列,最大长度为64字节,用于将凭据映射到特定用户。(在通过JSON传递时编码为base64字符串)
ENAn 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签名计数器。每次成功验证后,该值会递增一。参见 https://w3c.github.io/webauthn/#signature-counter
ENSignature counter. This is incremented by one for each successful assertion. See https://w3c.github.io/webauthn/#signature-counter
largeBlobstring与凭证关联的大型二进制对象。请参阅 https://w3c.github.io/webauthn/#sctn-large-blob-extension(通过 JSON 传递时以 base64 字符串格式编码)
ENThe 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)
backupEligibilityboolean此凭据返回的断言将具有备份资格(BE)标志,该标志将设置为该值。默认为认证器的默认备份资格值。
ENAssertions returned by this credential will have the backup eligibility (BE) flag set to this value. Defaults to the authenticator's defaultBackupEligibility value.
backupStateboolean此凭证返回的断言将把备份状态(BS)标志设置为该值。默认为认证器的 defaultBackupState 值。
ENAssertions returned by this credential will have the backup state (BS) flag set to this value. Defaults to the authenticator's defaultBackupState value.
userNamestring凭证的 user.name 属性。如果未设置,则等同于空值。https://w3c.github.io/webauthn/#dom-publickeycredentialentity-name
ENThe credential's user.name property. Equivalent to empty if not set. https://w3c.github.io/webauthn/#dom-publickeycredentialentity-name
userDisplayNamestring凭据的 user.displayName 属性。若未设置则等同于空值。https://w3c.github.io/webauthn/#dom-publickeycredentialuserentity-displayname
ENThe credential's user.displayName property. Equivalent to empty if not set. https://w3c.github.io/webauthn/#dom-publickeycredentialuserentity-displayname

📌WebAuthn.Ctap2Version

允许的值:ctap2_0ctap2_1

EN
Allowed Values: ctap2_0, ctap2_1

返回类型:string


📌WebAuthn.VirtualAuthenticatorOptions

返回类型:object

属性必填标记类型描述原文
protocol✔️AuthenticatorProtocol
ctap2VersionCtap2Version默认为ctap2_0。如果|protocol| == u2f则忽略。
ENDefaults to ctap2_0. Ignored if |protocol| == u2f.
transport✔️AuthenticatorTransport
hasResidentKeyboolean默认为 false。
ENDefaults to false.
hasUserVerificationboolean默认值为 false。
ENDefaults to false.
hasLargeBlobboolean如果设置为 true,认证器将支持 largeBlob 扩展。https://w3c.github.io/webauthn#largeBlob 默认值为 false。
ENIf set to true, the authenticator will support the largeBlob extension. https://w3c.github.io/webauthn#largeBlob Defaults to false.
hasCredBlobboolean如果设置为 true,认证器将支持 credBlob 扩展。 https://fidoalliance.org/specs/fido-v2.1-rd-20201208/fido-client-to-authenticator-protocol-v2.1-rd-20201208.html#sctn-credBlob-extension 默认为 false。
ENIf 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.
hasMinPinLengthboolean如果设置为true,认证器将支持minPinLength扩展功能。https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-minpinlength-extension 默认值为false。
ENIf 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.
hasPrfboolean如果设置为 true,认证器将支持 prf 扩展。 https://w3c.github.io/webauthn/#prf-extension 默认为 false。
ENIf set to true, the authenticator will support the prf extension. https://w3c.github.io/webauthn/#prf-extension Defaults to false.
automaticPresenceSimulationboolean如果设置为true,用户存在性测试将立即成功。否则,它们将不会被解决。默认值为true。
ENIf set to true, tests of user presence will succeed immediately. Otherwise, they will not be resolved. Defaults to true.
isUserVerifiedboolean设置身份验证器的用户验证是否成功。默认为失败。
ENSets whether User Verification succeeds or fails for an authenticator. Defaults to false.
defaultBackupEligibilityboolean由此认证器创建的凭证将具有备份资格(BE)标志,该标志将设置为该值。默认为 false。https://w3c.github.io/webauthn/#sctn-credential-backup
ENCredentials 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
defaultBackupStateboolean此认证器创建的凭据将把备份状态(BS)标志设置为该值。默认为 false。https://w3c.github.io/webauthn/#sctn-credential-backup
ENCredentials 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