mfa-webauthn-not-available-error 画面では、現在使用しているブラウザーまたはデバイスでは WebAuthn を利用できないことをユーザーに通知し、別の認証方法を試す選択肢を提供します。
各画面には、それぞれ専用のフックとメソッドが用意されています。SDK では、各画面ごとに部分インポートとルートインポートをサポートしています。
- 部分インポートを使うと、特定のユースケースに必要なコードだけを取り込めます。
- ルートインポートを使うと、1 つのバンドルからすべての画面を読み込めるため、あらゆる画面に対応する統一ビルドを用意したい場合に便利です。
// ルートインポート
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 からインポートします。
このフックは、mfa-webauthn-not-available-error 画面に表示されるロゴ、カラー、テーマ設定などのブランディング構成を提供します。import { useBranding } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function CustomTheme() {
const branding = useBranding();
}
このフックは、mfa-webauthn-not-available-error 画面の id、name、logoUrl など、クライアント関連の設定を提供します。import { useClient } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function AppInfo() {
const client = useClient();
}
このフックは、MFA フローが Organization スコープの場合に、ユーザーの Organization に関する情報を提供します。Organization コンテキストが存在しない場合は null を返します。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>;
}
}
このフックには、認証フローにおける現在のプロンプトに関するデータが含まれます。import { usePrompt } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function FlowInfo() {
const prompt = usePrompt();
}
このフックには、設定やコンテキストを含む mfa-webauthn-not-available-error 画面固有の詳細情報が含まれます。import { useScreen } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function ScreenDebug() {
const screen = useScreen();
}
このフックには、id や関連メタデータなど、テナントに関するデータが含まれます。import { useTenant } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function TenantInfo() {
const tenant = useTenant();
}
このフックは、現在の MFA フローの状態など、mfa-webauthn-not-available-error 画面に関するトランザクション固有のデータを提供します。import { useTransaction } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function TransactionInfo() {
const transaction = useTransaction();
}
このフックは、URL パラメータで事前入力された値など、画面に渡される未検証データを扱います。import { useUntrustedData } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function PrefilledForm() {
const untrustedData = useUntrustedData();
}
このフックは、username、email、利用可能な認証方法など、現在のユーザーに関する情報を提供します。import { useUser } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function UserProfile() {
const user = useUser();
}
useMfaWebAuthnNotAvailableError
このフックは、mfa-webauthn-not-available-error 画面で利用できるすべてのメソッドとコンテキストを返します。
このメソッドは MFA の認証方法選択画面に遷移し、ユーザーが別の認証要素を選べるようにします。import { useMfaWebAuthnNotAvailableError } from '@auth0/auth0-acul-react/mfa-webauthn-not-available-error';
function TryAnotherMethodButton() {
const { tryAnotherMethod } = useMfaWebAuthnNotAvailableError();
return (
<button onClick={() => tryAnotherMethod()}>
別の方法を試す
</button>
);
}
このフックは、ブランディングコンテキストからフラット化された設定を含む現在のテーマオプションを取得します。
このフックは、現在の ACUL 画面の表示言語を変更するための関数を返します。
このフックは、現在の画面のコンテキストと状態を取得します。
このフックは、画面上のサーバーエラー、クライアントエラー、開発者エラーを読み取り、管理します。