From df821208c608de1b7cdc6fe69ae28724ac1f01a0 Mon Sep 17 00:00:00 2001 From: MDN Date: Thu, 14 Oct 2021 00:47:38 +0000 Subject: [CRON] sync translated content --- .../web/api/credentialscontainer/create/index.html | 105 +++++++++++++++ .../index.html | 147 +++++++++++++++++++++ 2 files changed, 252 insertions(+) create mode 100644 files/ja/conflicting/web/api/credentialscontainer/create/index.html create mode 100644 files/ja/conflicting/web/api/credentialscontainer/create_18148a708412fc42b1affe2f08eab270/index.html (limited to 'files/ja/conflicting/web/api') diff --git a/files/ja/conflicting/web/api/credentialscontainer/create/index.html b/files/ja/conflicting/web/api/credentialscontainer/create/index.html new file mode 100644 index 0000000000..7203131ea6 --- /dev/null +++ b/files/ja/conflicting/web/api/credentialscontainer/create/index.html @@ -0,0 +1,105 @@ +--- +title: PublicKeyCredentialCreationOptions.excludeCredentials +slug: conflicting/Web/API/CredentialsContainer/create +tags: + - API + - Property + - PublicKeyCredentialCreationOptions + - Reference + - Web Authentication API + - WebAuthn + - プロパティ +translation_of: Web/API/PublicKeyCredentialCreationOptions/excludeCredentials +original_slug: Web/API/PublicKeyCredentialCreationOptions/excludeCredentials +--- +
{{APIRef("Web Authentication API")}}{{securecontext_header}}
+ +

excludeCredentials は {{domxref("PublicKeyCredentialCreationOptions")}} 辞書の任意のプロパティであり、指定されたユーザーに既に存在する公開鍵の記述子を要素に持つ {{jsxref("Array")}} オブジェクトです。これは既存のユーザーに新しい認証情報を生成することを避けたい場合、パーティのサーバーから提供されます。

+ +

構文

+ +
excludeCredentials = publicKeyCredentialCreationOptions.excludeCredentials
+ +

+ +

{{jsxref("Array")}} で、以下のプロパティを持つオブジェクトを要素に持ちます。

+ +
+
type
+
文字列で、生成された公開鍵の認証情報の種類を表します。この文書の執筆時点 (2019年3月) では、 "public-key" のみが使用可能です。
+
id
+
{{domxref("BufferSource")}} で、既存の公開鍵の認証情報の識別子 ({{domxref("PublicKeyCredential.rawId")}}) に一致します。子の識別子は PublicKeyCredential インスタンスの生成時に生成されます。
+
transports {{optional_inline}}
+
文字列の {{jsxref("Array")}} で、クライアントと認証機器の通信方法を記述します。使用可能な文字列は次の通りです。 +
    +
  • "usb": 認証機器は取り外し可能な USB 接続で接続することができます
  • +
  • "nfc": 認証機器は NFC (Near Field Communication) を通して使用することができます
  • +
  • "ble": 認証機器は BLE (Bluetooth Low Energy) を通して使用することができます
  • +
  • "internal": 認証機器はクライアント端末の中に埋め込まれています (取り外せません)。
  • +
+
+
+ +

認証機器がすでにそのような公開鍵認証情報の一つを含んでいる場合、クライアントは {{domxref("DOMException")}} を発生さえるか、ユーザーに新しい認証情報を生成したいかを確認するかします。

+ +

+ +
var publicKey = {
+  excludeCredentials: [
+    {
+      type: "public-key",
+      // the id for john.doe@example.com
+      id  : new Uint8Array(26) /* this actually is given by the server */
+    },
+    {
+      type: "public-key",
+      // the id for john-doe@example.com
+      id : new Uint8Array(26) /* another id */
+    }
+  ],
+  challenge: new Uint8Array(26) /* this actually is given from the server */,
+  rp: {
+    name: "Example CORP",
+    id  : "login.example.com"
+  },
+  user: {
+    id: new Uint8Array(26), /* To be changed for each user */
+    name: "jdoe@example.com",
+    displayName: "John Doe",
+  },
+  pubKeyCredParams: [ {
+    type: "public-key",
+    alg: -7 } ]
+};
+
+navigator.credentials.create({ publicKey })
+  .then(function (newCredentialInfo) {
+    // send attestation response and client extensions
+    // to the server to proceed with the registration
+    // of the credential
+  }).catch(function (err) {
+     console.error(err);
+  });
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('WebAuthn','#dom-publickeycredentialcreationoptions-excludecredentials','excludeCredentials')}}{{Spec2('WebAuthn')}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("api.PublicKeyCredentialCreationOptions.excludeCredentials")}}

diff --git a/files/ja/conflicting/web/api/credentialscontainer/create_18148a708412fc42b1affe2f08eab270/index.html b/files/ja/conflicting/web/api/credentialscontainer/create_18148a708412fc42b1affe2f08eab270/index.html new file mode 100644 index 0000000000..42f3cdcdfa --- /dev/null +++ b/files/ja/conflicting/web/api/credentialscontainer/create_18148a708412fc42b1affe2f08eab270/index.html @@ -0,0 +1,147 @@ +--- +title: PublicKeyCredentialCreationOptions +slug: >- + conflicting/Web/API/CredentialsContainer/create_18148a708412fc42b1affe2f08eab270 +tags: + - API + - Dictionary + - PublicKeyCredentialCreationOptions + - Reference + - Web Authentication API + - WebAuthn +translation_of: Web/API/PublicKeyCredentialCreationOptions +original_slug: Web/API/PublicKeyCredentialCreationOptions +--- +
{{APIRef("Web Authentication API")}}{{securecontext_header}}
+ +

PublicKeyCredentialCreationOptionsWeb Authentication API の辞書で、 {{domxref("CredentialsContainer.create()","navigators.credentials.create()")}} で {{domxref("PublicKeyCredential")}} を生成するために渡されるオプションを保持します。

+ +

プロパティ

+ +
+
{{domxref("PublicKeyCredentialCreationOptions.rp")}}
+
資格情報の生成のリクエスト元を示すオブジェクトです。
+
{{domxref("PublicKeyCredentialCreationOptions.user")}}
+
資格情報が生成されるユーザーアカウントを示すオブジェクトです。
+
{{domxref("PublicKeyCredentialCreationOptions.challenge")}}
+
{{domxref("BufferSource")}} 型で、証明書利用者のサーバーによって生成され、暗号チャレンジとして使用されるものです。この値は認証プロバイダーによって署名され、署名は {{domxref("AuthenticatorAssertionResponse.signature")}} の一部として送り返されます。
+
{{domxref("PublicKeyCredentialCreationOptions.pubKeyCredParams")}}
+
{{jsxref("Array")}} 型で、資格情報に要求される機能を指定する要素の配列です。暗号化署名の操作で使用される種類とアルゴリズムを含みます。この配列は設定の降順で並べ替えられます。
+
{{domxref("PublicKeyCredentialCreationOptions.timeout")}} {{optional_inline}}
+
数値のヒントで、取得操作が完了するまで呼び出し元が待機する時間をミリ秒単位で表します。このヒントは、ブラウザーによって上書きされる場合があります。
+
{{domxref("PublicKeyCredentialCreationOptions.excludeCredentials")}} {{optional_inline}}
+
{{jsxref("Array")}} で、既存の資格情報の記述子の配列です。これは、すでに資格情報を持つ既存のユーザーが新しい公開鍵資格情報を生成することを防ぐために、認証者によって提供されます。
+
{{domxref("PublicKeyCredentialCreationOptions.authenticatorSelection")}} {{optional_inline}}
+
生成操作で使用可能な認証機器を絞り込む条件をプロパティに持つオブジェクトです。
+
{{domxref("PublicKeyCredentialCreationOptions.attestation")}} {{optional_inline}}
+
{{jsxref("String")}} で、認証結果を (認証機器の元が) 送信する方法を示します。
+
{{domxref("PublicKeyCredentialCreationOptions.extensions")}} {{optional_inline}}
+
複数のクライアント拡張機能の入力を持つオブジェクトです。これらの拡張機能は、追加の処理を要求するために使用されます (例えば、従来の FIDO API 資格情報を処理、認証端末上でのテキストの要求など)。
+
+ +

メソッド

+ +

なし。

+ +

+ +
// some examples of COSE algorithms
+const cose_alg_ECDSA_w_SHA256 = -7;
+const cose_alg_ECDSA_w_SHA512 = -36;
+
+var createCredentialOptions = {
+    // Format of new credentials is publicKey
+    publicKey: {
+        // Relying Party
+        rp: {
+            name: "Example CORP",
+            id: "login.example.com",
+            icon: "https://login.example.com/login.ico"
+        },
+        // Cryptographic challenge from the server
+        challenge: new Uint8Array(26),
+        // User
+        user: {
+            id: new Uint8Array(16),
+            name: "john.p.smith@example.com",
+            displayName: "John P. Smith",
+        },
+        // Requested format of new keypair
+        pubKeyCredParams: [{
+            type: "public-key",
+            alg: cose_alg_ECDSA_w_SHA256,
+        }],
+        // Timeout after 1 minute
+        timeout: 60000,
+        // Do not send the authenticator's origin attestation
+        attestation: "none",
+        extensions: {
+          uvm: true,
+          exts: true
+        },
+        // Filter out authenticators which are bound to the device
+        authenticatorSelection:{
+          authenticatorAttachment: "cross-platform",
+          requireResidentKey: true,
+          userVerification: "preferred"
+        },
+        // Exclude already existing credentials for the user
+        excludeCredentials: [
+          {
+            type: "public-key",
+            // the id for john.doe@example.com
+            id  : new Uint8Array(26) /* this actually is given by the server */
+          },
+          {
+            type: "public-key",
+            // the id for john-doe@example.com
+            id : new Uint8Array(26) /* another id */
+          }
+        ]
+    }
+};
+
+// Create the new credential with the options above
+navigator.credentials.create(createCredentialOptions)
+  .then(function (newCredentialInfo) {
+    var attestationResponse = newCredentialInfo.response;
+    var clientExtensionsOutputs = newCredentialInfo.getClientExtensionsResults();
+
+    // Send the response to the relying party server
+    // it will verify the content and integrity before
+    // creating a new credential
+
+  }).catch(function (err) {
+    // Deal with any error properly
+    console.error(err);
+  });;
+
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('WebAuthn','#dictdef-publickeycredentialcreationoptions', 'PublicKeyCredentialCreationOptions dictionary')}}{{Spec2('WebAuthn')}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("api.PublicKeyCredentialCreationOptions")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf