AuthenticatorResponse

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2021.

安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (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);
  });

仕様書

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

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
AuthenticatorResponse
clientDataJSON

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
See implementation notes.
Has more compatibility info.

関連情報