AuthenticatorAttestationResponse
Baseline
広く利用可能
*
この機能は広く実装されており、多くのバージョンの端末やブラウザーで動作します。2021年9月以降、すべてのブラウザーで利用可能です。
* この機能の一部は、対応レベルが異なる場合があります。
安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。
AuthenticatorAttestationResponse は Web Authentication API のインターフェイスで、 CredentialsContainer.create() に PublicKeyCredential を渡すと返されます。そして、生成された新しいキーペアの暗号化信頼ルートを提供します。このレスポンスは認証情報の生成を完了させるために、信頼されている側のサーバーに送信されます。
このインターフェイスは AuthenticatorResponse を継承しています。
メモ:
このインターフェイスは最上位のコンテキストに限定されています。 <iframe> 要素の中で使用しても、何も効果がありません。
プロパティ
AuthenticatorAttestationResponse.clientDataJSON安全なコンテキスト用読取専用-
認証のためのクライアントデータで、オリジンやチャレンジです。
clientDataJSONプロパティはAuthenticatorResponseから継承しています。 AuthenticatorAttestationResponse.attestationObject安全なコンテキスト用読取専用-
ArrayBufferで、新しく生成されたキーペアのための認証機器のデータとアテステーションステートメントが入ります。
メソッド
AuthenticatorAttestationResponse.getTransports()安全なコンテキスト用-
文字列の
Arrayで、認証機器がどの転送方法 (usbやnfcなど) に対応していると信じられるかを記述します。情報が利用できない場合は、配列が空になることがあります。
例
js
var publicKey = {
challenge: /* from the server */,
rp: {
name: "Example CORP",
id : "login.example.com"
},
user: {
id: new Uint8Array(16),
name: "jdoe@example.com",
displayName: "John Doe"
},
pubKeyCredParams: [
{
type: "public-key",
alg: -7
}
]
};
navigator.credentials.create({ publicKey })
.then(function (newCredentialInfo) {
var response = newCredentialInfo.response;
// Do something with the response
// (sending it back to the relying party server maybe?)
}).catch(function (err) {
console.error(err);
});
仕様書
| 仕様書 |
|---|
| Web Authentication: An API for accessing Public Key Credentials - Level 3> # authenticatorattestationresponse> |
ブラウザーの互換性
関連情報
AuthenticatorAssertionResponse: 既存の認証情報を受け取る際にレスポンスの種類のインターフェイスAuthenticatorResponse: 親インターフェイス