--- title: AuthenticatorResponse slug: Web/API/AuthenticatorResponse tags: - API - Authentication - AuthenticatorResponse - Interface - Reference - Web Authentication API - WebAuthn - インターフェイス translation_of: Web/API/AuthenticatorResponse ---
AuthenticatorResponse は Web Authentication API のインターフェイスで、キーペアを信頼する暗号化ルートを提供するインターフェイスの基本インターフェイスです。子インターフェイスでは、チャレンジのオリジンなどのブラウザーからの情報を含み、 {{domxref("PublicKeyCredential.response")}} から返されることがあります。
以下のインターフェイスは AuthenticatorResponse インターフェイスに基づいています。
なし。
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);
});
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);
});
| 仕様書 | 状態 | 備考 |
|---|---|---|
| {{SpecName('WebAuthn','#authenticatorresponse', 'AuthenticatorResponse interface')}} | {{Spec2('WebAuthn')}} | 初回定義 |
{{Compat("api.PublicKeyCredentialRequestOptions")}}