AuthenticatorResponse

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

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

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

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

プロパティ

AuthenticatorResponse.clientDataJSON (en-US)

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

メソッド

なし。

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);
  });

仕様書

Specification
Web Authentication: An API for accessing Public Key Credentials - Level 3
# authenticatorresponse

ブラウザーの互換性

BCD tables only load in the browser

関連情報