AuthenticatorAssertionResponse - Web APIs 编辑

Secure context

This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The AuthenticatorAssertionResponse interface of the Web Authentication API is returned by CredentialsContainer.get() when a PublicKeyCredential is passed, and provides proof to a service that it has a key pair and that the authentication request is valid and approved.

This interface inherites from AuthenticatorResponse.

Note: This interface is restricted to top-level contexts. Use from within an <iframe> element will not have any effect.

Properties

AuthenticatorAssertionResponse.clientDataJSON Secure contextRead only
The client data for the authentication, such as origin and challenge. The clientDataJSON property is inherited from the AuthenticatorResponse.
AuthenticatorAssertionResponse.authenticatorData Secure contextRead only
An ArrayBuffer containing information from the authenticator such as the Relying Party ID Hash (rpIdHash), a signature counter, test of user presence and user verification flags, and any extensions processed by the authenticator.
AuthenticatorAssertionResponse.signature Secure contextRead only
An assertion signature over AuthenticatorAssertionResponse.authenticatorData and AuthenticatorResponse.clientDataJSON. The assertion signature is created with the private key of keypair that was created during the navigator.credentials.create() call and verified using the public key of that same keypair.
AuthenticatorAssertionResponse.userHandle Secure contextRead only
An ArrayBuffer containing an opaque user identifier.

Methods

None.

Examples

var options = {
  challenge: new Uint8Array([/* bytes sent from the server */])
};

navigator.credentials.get({ "publicKey": options })
    .then(function (credentialInfoAssertion) {
    var assertionResponse = credentialInfoAssertion.response;
    // Do something specific with the response

    // send assertion response back to the server
    // to proceed with the control of the credential
}).catch(function (err) {
     console.error(err);
});

Specifications

SpecificationStatusComment
Web Authentication: An API for accessing Public Key Credentials Level 1
The definition of 'AuthenticatorAssertionResponse interface' in that specification.
RecommendationInitial definition.

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:153 次

字数:5363

最后编辑:6年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文