> ## Documentation Index
> Fetch the complete documentation index at: https://translations.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# MfaRecoveryCodeChallenge

> Universal Login の `mfa-recovery-code-challenge` 画面をカスタマイズするために利用できるすべてのHooksとメソッドについて説明します。

`mfa-recovery-code-challenge` 画面では、他の MFA方式 が利用できない場合に、本人確認のため リカバリーコード の入力を求められます。

<Frame>
  <img style={{maxHeight:"400px"}} src="https://mintcdn.com/translations/aihf6huT3dcoAQFg/docs/images/ja-jp/cdy7uua7fh8z/5yYzaRgj3y0g6fKLga8hD6/0b46a45ed656a3a0b96d8e0c40d00a24/Screenshot_2025-04-23_at_18.56.09.png?fit=max&auto=format&n=aihf6huT3dcoAQFg&q=85&s=4b10ac7a80dc0f7aefe69db84c2a3698" alt="MfaRecoveryCodeChallenge" width="363" height="494" data-path="docs/images/ja-jp/cdy7uua7fh8z/5yYzaRgj3y0g6fKLga8hD6/0b46a45ed656a3a0b96d8e0c40d00a24/Screenshot_2025-04-23_at_18.56.09.png" />
</Frame>

<div id="import">
  ## インポート
</div>

各画面には、それぞれ固有のHooksとメソッドがあります。SDK は、各画面で **partial import** と **root import** をサポートしています。

* partial import を使用すると、特定のユースケースに必要なコードだけを取り込めます。
* root import を使用すると、1 つのバンドルからすべての画面を読み込めます。これは、想定されるすべての画面を 1 つの統一されたビルドで扱いたい場合に便利です。

```jsx Import Example theme={null}
// ルートインポート
import { useMfaRecoveryCodeChallenge } from '@auth0/auth0-acul-react';

// 部分インポート
import {
  useMfaRecoveryCodeChallenge,
  // コンテキストHooks
  useUser,
  useTenant,
  useBranding,
  useClient,
  useOrganization,
  usePrompt,
  useScreen,
  useTransaction,
  useUntrustedData,
  // 共通Hooks
  useCurrentScreen,
  useAuth0Themes,
  useErrors,
  // ユーティリティHooks
  useChangeLanguage,
  // メソッド
  continueMethod,
  tryAnotherMethod,
} from "@auth0/auth0-acul-react/mfa-recovery-code-challenge";

function MfaRecoveryCodeChallengeScreen() {
  const { continueMethod } = useMfaRecoveryCodeChallenge();
  return (
    <button onClick={() => continueMethod({ code: 'XXXX XXXX XXXX XXXX' })}>
      Verify Recovery Code
    </button>
  );
}
```

<div id="context-hooks">
  ## Context Hooks
</div>

`mfa-recovery-code-challenge` 画面で Auth0 のコンテキストデータへの読み取り専用アクセスを提供する、画面にスコープが設定されたHooksです。`@auth0/auth0-acul-react/mfa-recovery-code-challenge` からインポートします。

<ParamField body="useBranding" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/BrandingMembers">BrandingMembers</a></span>}>
  このHooksは、`mfa-recovery-code-challenge` 画面に表示されるロゴ、色、テーマ設定などのブランディング設定を提供します。

  ```jsx Example theme={null}
  import { useBranding } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge';
  function CustomTheme() {
    const branding = useBranding();
  }
  ```
</ParamField>

<ParamField body="useClient" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ClientMembers">ClientMembers</a></span>}>
  このHooksは、`mfa-recovery-code-challenge` 画面の `id`、`name`、`logoUrl` など、クライアント関連の設定を提供します。

  ```jsx Example theme={null}
  import { useClient } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge';
  function AppInfo() {
    const client = useClient();
  }
  ```
</ParamField>

<ParamField body="useOrganization" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/OrganizationMembers">OrganizationMembers</a></span>}>
  このHooksは、MFAフローに組織のスコープが設定されている場合に、ユーザーの組織に関する情報を提供します。組織コンテキストが存在しない場合は `null` を返します。

  ```jsx Example theme={null}
  import { useOrganization } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge';
  function OrgSelector() {
    const organization = useOrganization();
    if (!organization) {
      return <p>No organization context</p>;
    }
  }
  ```
</ParamField>

<ParamField body="usePrompt" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/PromptMembers">PromptMembers</a></span>}>
  このHooksには、認証フロー内の現在の prompt に関するデータが含まれます。

  ```jsx Example theme={null}
  import { usePrompt } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge';
  function FlowInfo() {
    const prompt = usePrompt();
  }
  ```
</ParamField>

<ParamField body="useScreen" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ScreenMembers">ScreenMembers</a></span>}>
  このHooksには、設定やコンテキストなど、`mfa-recovery-code-challenge` 画面に固有の詳細が含まれます。

  ```jsx Example theme={null}
  import { useScreen } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge';
  function ScreenDebug() {
    const screen = useScreen();
  }
  ```
</ParamField>

<ParamField body="useTenant" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/TenantMembers">TenantMembers</a></span>}>
  このHooksには、`id` や関連するメタデータなど、tenant に関連するデータが含まれます。

  ```jsx Example theme={null}
  import { useTenant } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge';
  function TenantInfo() {
    const tenant = useTenant();
  }
  ```
</ParamField>

<ParamField body="useTransaction" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/TransactionMembers">TransactionMembers</a></span>}>
  このHooksは、現在のMFAフローの状態など、`mfa-recovery-code-challenge` 画面における transaction 固有のデータを提供します。

  ```jsx Example theme={null}
  import { useTransaction } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge';
  function TransactionInfo() {
    const transaction = useTransaction();
  }
  ```
</ParamField>

<ParamField body="useUntrustedData" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/UntrustedDataMembers">UntrustedDataMembers</a></span>}>
  このHooksは、URLパラメーターから事前入力された値など、画面に渡される信頼できないデータを扱います。

  ```jsx Example theme={null}
  import { useUntrustedData } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge';
  function PrefilledForm() {
    const untrustedData = useUntrustedData();
  }
  ```
</ParamField>

<ParamField body="useUser" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/UserMembers">UserMembers</a></span>}>
  このHooksは、`username`、`email`、利用可能な認証方法など、現在のユーザーの詳細を提供します。

  ```jsx Example theme={null}
  import { useUser } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge';
  function UserProfile() {
    const user = useUser();
  }
  ```
</ParamField>

<ParamField body="useMfaRecoveryCodeChallenge" type={<a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/MfaRecoveryCodeChallengeMembers">MfaRecoveryCodeChallengeMembers</a>}>
  このHooksは、`mfa-recovery-code-challenge` 画面で利用可能なすべてのメソッドとコンテキストを返します。
</ParamField>

<div id="methods">
  ## メソッド
</div>

<ParamField body="continueMethod" type="Promise<void>">
  このメソッドは、MFAチャレンジを完了するために、ユーザーのリカバリーコードを送信します。

  ```jsx Example theme={null}
  import { useMfaRecoveryCodeChallenge } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge';

  function RecoveryCodeForm() {
    const { continueMethod } = useMfaRecoveryCodeChallenge();
    return (
      <button onClick={() => continueMethod({ code: 'XXXX XXXX XXXX XXXX' })}>
        Verify Recovery Code
      </button>
    );
  }
  ```

  **メソッドのパラメータ**

  <Expandable title="パラメータ">
    <ParamField body="options">
      [MfaRecoveryCodeChallengeContinueOptions](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/MfaRecoveryCodeChallengeContinueOptions)。
    </ParamField>

    <ParamField body="code" type="string" required>
      検証のためにユーザーが入力したリカバリーコード。
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="tryAnotherMethod" type="Promise<void>">
  このメソッドはMFA方式の選択画面に移動し、ユーザーが別の認証要素を選択できるようにします。

  ```jsx Example theme={null}
  import { useMfaRecoveryCodeChallenge } from '@auth0/auth0-acul-react/mfa-recovery-code-challenge';

  function TryAnotherMethodButton() {
    const { tryAnotherMethod } = useMfaRecoveryCodeChallenge();
    return (
      <button onClick={() => tryAnotherMethod()}>
        Try Another Method
      </button>
    );
  }
  ```
</ParamField>

<div id="commonutility-hooks">
  ## 共通/ユーティリティ Hooks
</div>

<ParamField body={<a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useAuth0Themes">useAuth0Themes</a>} type="Hooks">
  このHooksは、ブランディングのコンテキストから、フラット化された設定を含む現在のテーマオプションを取得します。
</ParamField>

<ParamField body={<a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useChangeLanguage">useChangeLanguage</a>} type="Hooks">
  このHooksは、現在の ACUL 画面の表示言語を変更するための関数を返します。
</ParamField>

<ParamField body={<a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useCurrentScreen">useCurrentScreen</a>} type="Hooks">
  このHooksは、現在の画面のコンテキストと状態を取得します。
</ParamField>

<ParamField body={<a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useErrors">useErrors</a>} type="Hooks">
  このHooksは、画面上のサーバーエラー、クライアントエラー、開発者エラーを読み取り、管理します。
</ParamField>
