AuthenticatorAttestationResponse: phương thức getAuthenticatorData()
Baseline
2023
Newly available
Since October 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Phương thức getAuthenticatorData() của giao diện AuthenticatorAttestationResponse trả về một ArrayBuffer chứa dữ liệu authenticator nằm trong thuộc tính AuthenticatorAttestationResponse.attestationObject.
Đây là một hàm tiện ích, được tạo ra để cho phép truy cập dễ dàng vào dữ liệu authenticator mà không cần viết thêm mã phân tích để trích xuất nó từ attestationObject.
Cú pháp
getAuthenticatorData()
Tham số
Không có.
Giá trị trả về
Một ArrayBuffer có byteLength ít nhất là 37 byte, chứa cấu trúc dữ liệu được giải thích trong Authenticator data.
Giá trị này sẽ tương đương với dữ liệu authenticator chứa trong thuộc tính AuthenticatorAttestationResponse.attestationObject.
Ví dụ
Xem Creating a public key credential để có ví dụ chi tiết.
Thông số kỹ thuật
| Specification |
|---|
| Web Authentication: An API for accessing Public Key Credentials - Level 3> # dom-authenticatorattestationresponse-getauthenticatordata> |