--- title: PublicKeyCredentialRequestOptions slug: Web/API/PublicKeyCredentialRequestOptions tags: - API - Dictionary - PublicKeyCredentialRequestOptions - Reference - Web Authentication API - WebAuthn - 辞書 translation_of: Web/API/PublicKeyCredentialRequestOptions ---
PublicKeyCredentialRequestOptions は Web Authentication API の辞書で、 {{domxref("CredentialsContainer.get()","navigator.credentials.get()")}} で指定された {{domxref("PublicKeyCredential")}} を読み取るために渡されるオプションを保持します。
"login.example.org") を示します。このオプションが指定されていない場合、クライアントは現在のオリジンのドメインを使用します。なし。
var options = {
challenge: new Uint8Array([/* bytes sent from the server */]),
rpId: "example.com" /* will only work if the current domain
is something like foo.example.com */
userVerification: "preferred",
timeout: 60000, // Wait for a minute
allowCredentials: [
{
transports: "usb",
type: "public-key",
id: new Uint8Array(26) // actually provided by the server
},
{
transports: "internal",
type: "public-key",
id: new Uint8Array(26) // actually provided by the server
}
],
extensions: {
uvm: true, // RP wants to know how the user was verified
loc: false,
txAuthSimple: "Could you please verify yourself?"
}
};
navigator.credentials.get({ "publicKey": options })
.then(function (credentialInfoAssertion) {
// send assertion response back to the server
// to proceed with the control of the credential
}).catch(function (err) {
console.error(err);
});
| 仕様書 | 状態 | 備考 |
|---|---|---|
| {{SpecName('WebAuthn','#dictdef-publickeycredentialrequestoptions', 'PublicKeyCredentialRequestOptions dictionary')}} | {{Spec2('WebAuthn')}} | 初回定義 |
{{Compat("api.PublicKeyCredentialRequestOptions")}}