メインコンテンツへスキップ
mfa-webauthn-not-available-error 画面では、現在使用しているブラウザーまたはデバイスでは WebAuthn を利用できないことをユーザーに通知し、別の認証方法を試す選択肢を提供します。
MfaWebAuthnNotAvailableError

インポート

各画面には、それぞれ専用のフックとメソッドが用意されています。SDK では、各画面ごとに部分インポートルートインポートをサポートしています。
  • 部分インポートを使うと、特定のユースケースに必要なコードだけを取り込めます。
  • ルートインポートを使うと、1 つのバンドルからすべての画面を読み込めるため、あらゆる画面に対応する統一ビルドを用意したい場合に便利です。
Import Example
// ルートインポート
import { useMfaWebAuthnNotAvailableError } from '@auth0/auth0-acul-react';

// 部分インポート
import {
  useMfaWebAuthnNotAvailableError,
  // コンテキストフック
  useUser,
  useTenant,
  useBranding,
  useClient,
  useOrganization,
  usePrompt,
  useScreen,
  useTransaction,
  useUntrustedData,
  // 共通フック
  useCurrentScreen,
  useAuth0Themes,
  useErrors,
  // ユーティリティフック
  useChangeLanguage,
  // メソッド
  tryAnotherMethod,
} from "@auth0/auth0-acul-react/mfa-webauthn-not-available-error";

function MfaWebAuthnNotAvailableErrorScreen() {
  const { tryAnotherMethod } = useMfaWebAuthnNotAvailableError();
  return (
    <button onClick={() => tryAnotherMethod()}>
      Try Another Method
    </button>
  );
}

コンテキストフック

mfa-webauthn-not-available-error 画面で Auth0 のコンテキストデータへの読み取り専用アクセスを提供する、画面スコープのフックです。@auth0/auth0-acul-react/mfa-webauthn-not-available-error からインポートします。
useBranding
このフックは、mfa-webauthn-not-available-error 画面に表示されるロゴ、カラー、テーマ設定などのブランディング構成を提供します。
Example
import { useBranding } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function CustomTheme() {
  const branding = useBranding();
}
useClient
このフックは、mfa-webauthn-not-available-error 画面の idnamelogoUrl など、クライアント関連の設定を提供します。
Example
import { useClient } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function AppInfo() {
  const client = useClient();
}
useOrganization
このフックは、MFA フローが Organization スコープの場合に、ユーザーの Organization に関する情報を提供します。Organization コンテキストが存在しない場合は null を返します。
Example
import { useOrganization } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function OrgSelector() {
  const organization = useOrganization();
  if (!organization) {
    return <p>No organization context</p>;
  }
}
usePrompt
このフックには、認証フローにおける現在のプロンプトに関するデータが含まれます。
Example
import { usePrompt } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function FlowInfo() {
  const prompt = usePrompt();
}
useScreen
このフックには、設定やコンテキストを含む mfa-webauthn-not-available-error 画面固有の詳細情報が含まれます。
Example
import { useScreen } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function ScreenDebug() {
  const screen = useScreen();
}
useTenant
このフックには、id や関連メタデータなど、テナントに関するデータが含まれます。
Example
import { useTenant } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function TenantInfo() {
  const tenant = useTenant();
}
useTransaction
このフックは、現在の MFA フローの状態など、mfa-webauthn-not-available-error 画面に関するトランザクション固有のデータを提供します。
Example
import { useTransaction } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function TransactionInfo() {
  const transaction = useTransaction();
}
useUntrustedData
このフックは、URL パラメータで事前入力された値など、画面に渡される未検証データを扱います。
Example
import { useUntrustedData } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function PrefilledForm() {
  const untrustedData = useUntrustedData();
}
useUser
このフックは、usernameemail、利用可能な認証方法など、現在のユーザーに関する情報を提供します。
Example
import { useUser } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function UserProfile() {
  const user = useUser();
}
useMfaWebAuthnNotAvailableError
このフックは、mfa-webauthn-not-available-error 画面で利用できるすべてのメソッドとコンテキストを返します。

メソッド

tryAnotherMethod
Promise<void>
このメソッドは MFA の認証方法選択画面に遷移し、ユーザーが別の認証要素を選べるようにします。
Example
import { useMfaWebAuthnNotAvailableError } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';

function TryAnotherMethodButton() {
  const { tryAnotherMethod } = useMfaWebAuthnNotAvailableError();
  return (
    <button onClick={() => tryAnotherMethod()}>
      別の方法を試す
    </button>
  );
}

共通/ユーティリティ フック

このフックは、ブランディングコンテキストからフラット化された設定を含む現在のテーマオプションを取得します。
このフックは、現在の ACUL 画面の表示言語を変更するための関数を返します。
このフックは、現在の画面のコンテキストと状態を取得します。
フック
このフックは、画面上のサーバーエラー、クライアントエラー、開発者エラーを読み取り、管理します。