> ## 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.

# チャレンジリクエスト

> トークン endpoint で認証を続行するための MFA チャレンジ（OTP または OOB）をリクエストします。

export const ResponseSchema = ({statusCode, type = "{}", children}) => {
  const [open, setOpen] = useState(false);
  return <div className="border border-gray-100 dark:border-gray-800 rounded-lg mb-3 overflow-hidden">
      <div className={`flex items-center gap-2.5 px-4 py-2.5 cursor-pointer select-none ${open ? "bg-gray-50 dark:bg-gray-800" : ""}`} onClick={() => setOpen(!open)}>
        {statusCode && <span className="border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 font-mono text-xs px-1.5 py-0.5 rounded">
            {statusCode.startsWith("default") ? "default" : statusCode}
          </span>}
        <span className="text-gray-500 dark:text-gray-400 text-sm font-mono">
          {type}
        </span>
        <span className="text-gray-400 dark:text-gray-500 text-sm italic">
          application/json
        </span>
        <svg className={`ml-auto opacity-50 transition-transform duration-200 ${open ? "rotate-180" : ""}`} width="16" height="16" viewBox="0 0 16 16" fill="none">
          <path d="M4 6l4 4 4-4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
        </svg>
      </div>
      {open && <div className="px-4 pt-1 pb-3 border-t border-gray-100 dark:border-gray-800">
          {children}
        </div>}
    </div>;
};

<div id="endpoint">
  ## エンドポイント
</div>

`POST /mfa/challenge`

Multi-factor Authentication (MFA) API のエンドポイントを使用すると、ユーザーが[トークンエンドポイント](#get-token)を利用する際に MFA を必須にできるほか、ユーザーの認証器の登録や管理も行えます。

まず、アプリケーションとユーザーがサポートしているチャレンジの種類に応じて、チャレンジをリクエストします。ワンタイムパスワード (OTP) がサポートされていることがわかっている場合は、このチャレンジリクエストを省略できます。

次に、`/oauth/token` エンドポイントと指定したチャレンジの種類 (ワンタイムパスワード (OTP)、リカバリーコード、または帯域外 (OOB) チャレンジ) を使用して、多要素認証を検証します。

詳しくは、次を参照してください。

* [Multi-factor Authentication and Resource Owner Password](https://auth0.com/docs/secure/multi-factor-authentication/authenticate-using-ropg-flow-with-mfa)
* [Multi-factor Authentication API](https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-developer-resources/mfa-api)
* [Multi-factor Authentication in Auth0](https://auth0.com/docs/secure/multi-factor-authentication)

<div id="challenge-request">
  ## チャレンジリクエスト
</div>

アプリケーションとユーザーでサポートされているチャレンジの種類に応じて、多要素認証 (MFA) のチャレンジをリクエストします。

`challenge_type` は、ユーザーがどのようにチャレンジを受け取り、所持していることを証明するかを指定します。サポートされているチャレンジの種類は次のとおりです。

* `otp`: ワンタイムパスワード (OTP)
* `oob`: SMS／音声メッセージ、または帯域外 (OOB)

ユーザーが OTP に対応していて、別の要素をリクエストする必要がない場合は、チャレンジリクエストを省略し、[ワンタイムパスワードを使って多要素認証を検証](#verify-with-one-time-password-otp-)できます。

<div id="remarks">
  ### 注意事項
</div>

* このエンドポイントは登録をサポートしていません。チャレンジをリクエストする前に、ユーザーは希望する方法であらかじめ登録されている必要があります。
* Auth0 は、アプリケーションでサポートされている種類と、ユーザーが登録済みの種類に基づいて、チャレンジの種類を選択します。
* アプリケーションが、ユーザーが登録済みのチャレンジの種類をいずれもサポートしていない場合は、`unsupported_challenge_type` エラーが返されます。
* ユーザーが登録されていない場合は、`unsupported_challenge_type` エラーが返されます。
* ユーザーが登録されていない場合は、`association_required` エラーが返されます。これは、MFA を利用するにはユーザーの登録が必要であることを示します。進め方については、下記の [認証器を追加する](/multi-factor-authentication/add-an-authenticator) を参照してください。

<div id="learn-more">
  ### 詳しく見る
</div>

* [Resource Owner Password Grant と MFA を使用して認証する](https://auth0.com/docs/secure/multi-factor-authentication/authenticate-using-ropg-flow-with-mfa)
* [MFA API で認証器要素を管理する](https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authenticator-factors-mfa-api)

<div id="body-parameters">
  ## Body パラメーター
</div>

<ParamField body="mfa_token" type="string" required>
  `mfa_required` エラーで受け取ったトークン。
</ParamField>

<ParamField body="client_id" type="string" required>
  アプリケーションの Client ID。
</ParamField>

<ParamField body="client_secret" type="string">
  アプリケーションの Client Secret。
</ParamField>

<ParamField body="challenge_type" type="string">
  アプリケーションが受け入れるチャレンジの種類の空白区切りリスト。

  指定可能な値: `oob`, `otp`
</ParamField>

<ParamField body="client_assertion" type="string">
  アプリケーションの認証情報で署名したアサーションを含む JWT。
</ParamField>

<ParamField body="client_assertion_type" type="string">
  値は `urn:ietf:params:oauth:client-assertion-type:jwt-bearer` です。
</ParamField>

<ParamField body="authenticator_id" type="string">
  チャレンジ対象の認証器の ID。
</ParamField>

<div id="response-schema">
  ## レスポンススキーマ
</div>

<ResponseSchema statusCode="200">
  <ResponseField name="challenge_type" type="string">
    この認証器が発行するチャレンジの種類。指定可能な値: `otp`, `oob`。
  </ResponseField>

  <ResponseField name="oob_code" type="string">
    帯域外チャレンジのコード。`challenge_type` が `oob` の場合にのみ含まれます。
  </ResponseField>

  <ResponseField name="binding_method" type="string">
    バインドに使用される方式。該当する場合にのみ含まれます。指定可能な値: `prompt`。
  </ResponseField>
</ResponseSchema>

<ResponseSchema statusCode="400">
  <ResponseField name="error" type="string">
    エラーコード。
  </ResponseField>

  <ResponseField name="error_description" type="string">
    エラーの詳細説明。
  </ResponseField>
</ResponseSchema>

<div id="response-messages">
  ## 応答メッセージ
</div>

| Status | Description                            |
| ------ | -------------------------------------- |
| 200    | チャレンジリクエストに成功しました                      |
| 400    | サポートされていないチャレンジの種類や登録情報の不足など、無効なリクエスト。 |
