このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2021年9月⁩.

安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。

isUserVerifyingPlatformAuthenticatorAvailable()PublicKeyCredential インターフェイスの静的メソッドで、ユーザー検証プラットフォーム認証機能が利用できる場合に true に解決される Promise を返すメソッドです。

ユーザー検証プラットフォーム認証機能は、クライアント端末の一部であり(一般に取り外し不可)、ユーザーを識別するためにユーザーの操作を必要とする多要素認証機能の一種です。一般的なユーザー検証プラットフォーム認証機能には、以下のものがあります。

  • Touch ID または Face ID (macOS や iOS)
  • Windows Hello (Windows)
  • Android の端末アンロック(指紋認証、顔認証、PIN、など)

メモ: このメソッドは最上位のコンテキストでのみ使用することができます。例えば <iframe> では使用できません。

構文

js
isUserVerifyingPlatformAuthenticatorAvailable() 

引数

なし。

返値

ユーザーを認証するプラットフォーム認証が利用できるかどうかを示す論理値に解決する Promise です。

メモ: このメソッドは静的メソッドであり、インスタンスではなく PublicKeyCredential インターフェイス上で直接呼び出されます。

メモ: 以前の版の仕様では、論理値は、そのような認証装置が存在することを開示することに対するユーザーの同意も伝えていました。

js
PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()   .then((available) => {     if (available) {       // We can proceed with the creation of a PublicKeyCredential       // with this authenticator     } else {       // Use another kind of authenticator or a classical login/password       // workflow     }   })   .catch((err) => {     // Something went wrong     console.error(err);   }); 

仕様書

Specification
Web Authentication: An API for accessing Public Key Credentials - Level 3>
# dom-publickeycredential-isuserverifyingplatformauthenticatoravailable>

ブラウザーの互換性

関連情報