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 |
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| authenticatorId | AuthenticatorId |
🔨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.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| enableUI | boolean | 是否启用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 |
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| credential | Credential |
🔨WebAuthn.getCredentials
返回存储在给定虚拟认证器中的所有凭据。
EN
Returns all the credentials stored in the given virtual authenticator.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| authenticatorId | ✔️ | AuthenticatorId |
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| credentials | array[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
Allows setting credential properties. https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| authenticatorId | ✔️ | AuthenticatorId | |||
| credentialId | ✔️ | string | |||
| backupEligibility | boolean | ||||
| backupState | boolean |
🔨WebAuthn.setResponseOverrideBits
如果参数 isBogusSignature、isBadUV、isBadUP 不存在,则将其重置为 false。
EN
Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| authenticatorId | ✔️ | AuthenticatorId | |||
| isBogusSignature | boolean | 如果设置了isBogusSignature,会将认证器响应中的签名覆盖为零。默认为false。 | ENIf isBogusSignature is set, overrides the signature in the authenticator response to be zero. Defaults to false. | ||
| isBadUV | boolean | 如果isBadUV被设置,会覆盖认证器响应中标志位的UV位,将其置为零。默认为false。 | ENIf isBadUV is set, overrides the UV bit in the flags in the authenticator response to be zero. Defaults to false. | ||
| isBadUP | boolean | 如果设置了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().
| 参数 | 必填 | 标记 | 类型 | 描述 |
|---|