1. 開発者向けのウェブ技術
  2. Web API
  3. AuthenticatorResponse

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

AuthenticatorResponse

Baseline 広く利用可能

この機能は広く実装されており、多くのバージョンの端末やブラウザーで動作します。2021年9月以降、すべてのブラウザーで利用可能です。

安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。

AuthenticatorResponseWeb Authentication API のインターフェイスで、キーペアを信頼する暗号化ルートを提供するインターフェイスの基本インターフェイスです。子インターフェイスでは、チャレンジのオリジンなどのブラウザーからの情報を含み、 PublicKeyCredential.response から返されることがあります。

AuthenticatorResponse に基づくインターフェイス

以下のインターフェイスは AuthenticatorResponse インターフェイスに基づいています。

プロパティ

AuthenticatorResponse.clientDataJSON

JSON 文字列が入った ArrayBuffer で、 CredentialsContainer.create() または CredentialsContainer.get() に渡されたクライアントデータを表します。

メソッド

なし。

AuthenticatorAssertionResponse の取得

js
var options = {
 challenge: new Uint8Array([/* bytes sent from the server */]),
};
navigator.credentials
 .get({ publicKey: options })
 .then(function (credentialInfoAssertion) {
 var assertionResponse = credentialInfoAssertion.response;
 // send assertion response back to the server
 // to proceed with the control of the credential
 })
 .catch(function (err) {
 console.error(err);
 });

AuthenticatorAttestationResponse の取得

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 attestationResponse = newCredentialInfo.response;
 }).catch(function (err) {
 console.error(err);
 });

仕様書

仕様書
Web Authentication: An API for accessing Public Key Credentials - Level 3
# authenticatorresponse

ブラウザーの互換性

関連情報

MDN の改良に協力

協力方法を知る

このページは MDN の貢献者によって に最終更新されました。

AltStyle によって変換されたページ (->オリジナル) /