AuthenticatorAssertionResponse

Baseline 已广泛支持

此功能已成熟,并可在多种设备和浏览器版本上运行。自 2021 年 9 月起,所有浏览器均已支持此功能。

安全上下文: 此功能仅在安全上下文(HTTPS)中可用,且支持此功能的浏览器数量有限。

AuthenticatorAssertionResponse 接口是 Web Authentication API 的一部分,它包含特定 WebAuthn 凭据私钥生成的数字签名。依赖方服务器可以通过验证此签名来验证用户身份,例如在用户登录时。

AuthenticatorAssertionResponse 对象实例可在成功调用 navigator.credentials.get() 返回的 PublicKeyCredential 对象的 response 属性中找到。

此接口继承自 AuthenticatorResponse

AuthenticatorResponse AuthenticatorAssertionResponse

注意: 此接口仅限于顶级上下文。在 <iframe> 元素内部使用将不会产生任何效果。

实例属性

也继承了其父接口 AuthenticatorResponse 的属性。

AuthenticatorAssertionResponse.authenticatorData 只读

一个 ArrayBuffer,包含来自身份验证器(authenticator)的信息,例如 Relying Party ID Hash (rpIdHash)、签名计数器、用户存在性测试和用户验证标志,以及身份验证器处理的任何扩展。

AuthenticatorResponse.clientDataJSON 只读

包含从浏览器传递给身份验证器以使用此凭据进行身份验证的(即调用具有 publicKey 选项的 CredentialsContainer.get() 时)数据的 JSON 兼容序列化。这些数据包含来自传递给 get() 调用的选项中的一些信息,以及一些由浏览器控制的信息。

AuthenticatorAssertionResponse.signature 只读

AuthenticatorAssertionResponse.authenticatorDataAuthenticatorResponse.clientDataJSON 的断言签名。断言签名是使用在初始 navigator.credentials.create() 调用期间创建的密钥对的私钥生成的,并使用同一密钥对的公钥进行验证。

AuthenticatorAssertionResponse.userHandle 只读

一个 ArrayBuffer,包含一个不透明的用户标识符,该标识符在传递给初始 navigator.credentials.create() 调用的选项中指定为 user.id

实例方法

无。

示例

有关详细示例,请参阅检索公钥凭据

规范

规范
Web Authentication:访问公钥凭证的 API - 第 3 级
# iface-authenticatorassertionresponse

浏览器兼容性

另见