From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../getclientextensionresults/index.html | 109 +++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 files/ja/web/api/publickeycredential/getclientextensionresults/index.html (limited to 'files/ja/web/api/publickeycredential/getclientextensionresults') diff --git a/files/ja/web/api/publickeycredential/getclientextensionresults/index.html b/files/ja/web/api/publickeycredential/getclientextensionresults/index.html new file mode 100644 index 0000000000..325e75e058 --- /dev/null +++ b/files/ja/web/api/publickeycredential/getclientextensionresults/index.html @@ -0,0 +1,109 @@ +--- +title: PublicKeyCredential.getClientExtensionResults() +slug: Web/API/PublicKeyCredential/getClientExtensionResults +tags: + - API + - Method + - PublicKeyCredential + - Reference + - Web Authentication API + - WebAuthn +translation_of: Web/API/PublicKeyCredential/getClientExtensionResults +--- +
{{APIRef("Web Authentication API")}}{{securecontext_header}}
+ +

getClientExtensionResults() は {{domxref("PublicKeyCredential")}} インターフェイスのメソッドであり、 {{jsxref("ArrayBuffer")}} の形で拡張機能の識別子と、クライアントが処理した後の結果の対応表を返します。

+ +

PublicKeyCredential の生成または読み出し中 (それぞれ {{domxref("CredentialsContainer.create()","navigator.credentials.create()")}} および {{domxref("CredentialsContainer.get()","navigator.credentials.get()")}} で実施) に、それぞれ {{domxref("PublicKeyCredentialCreationOptions.extensions")}} および {{domxref("PublicKeyCredentialRequestOptions.extensions")}} によって与えられる別々の拡張機能のために、クライアントが処理する「専用の」処理を持つことができます。

+ +
+

メモ: 拡張機能はオプションであり、ブラウザーによって認識する拡張機能は異なります。すべての拡張機能はクライアントが処理することはオプションです。ブラウザーが指定された拡張機能を知らない場合、失敗としてはいけません。

+
+ +
+

メモ: このプロパティは最上位のコンテキストでしか使えない可能性があり、例えば {{HTMLElement("iframe")}} の中では利用できません。

+
+ +

構文

+ +
mapArrayBuffer = publicKeyCredential.getClientExtensionResults()
+ +

引数

+ +

なし。

+ +

返値

+ +

{{jsxref("ArrayBuffer")}} の形で、クライアントが様々な拡張機能を処理した結果です。拡張子の識別子と、クライアントが処理した後の結果の対応表を返します。このオブジェクトには拡張機能の識別子と処理の結果の対応表が入っています。

+ +
+

警告! 2019年3月時点で、 appId ({{domxref("PublicKeyCredentialRequestOptions.extensions")}} の生成の間に使用される) のみ、 Chrome および Edge が対応しています。 Firefox はどの拡張機能にも対応していないようです。

+
+ +

+ +
var publicKey = {
+  // Here are the extensions (as "inputs")
+  extensions: {
+    "loc": true, // This extension has been defined to include location information in attestation
+    "uvi": true  // user verification index: how the user was verified
+  },
+  challenge: new Uint8Array(16) /* from the server */,
+  rp: {
+    name: "Example CORP",
+    id  : "login.example.com"
+  },
+  user: {
+    id: new Uint8Array(16) /* from the server */,
+    name: "jdoe@example.com",
+    displayName: "John Doe"
+  },
+  pubKeyCredParams: [
+    {
+      type: "public-key",
+      alg: -7
+    }
+  ]
+};
+
+navigator.credentials.create({ publicKey })
+  .then(function (newCredentialInfo) {
+    var myBuffer = newCredentialInfo.getClientExtensionResults();
+    // myBuffer will contain the result of any of the processing of the "loc" and "uvi" extensions
+  }).catch(function (err) {
+     console.error(err);
+  });
+ +

仕様書

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

ブラウザーの互換性

+ + + +

{{Compat("api.PublicKeyCredential.getClientExtensionResults")}}

+ +

関連情報

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