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

瀏覽器相容性

另見