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

# 認証器を追加

> ユーザーに新しい認証器を関連付け、多要素認証（MFA）を有効にします。

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/associate`

多要素認証 (MFA) 用の新しい認証要素を関連付けて追加します。

ユーザーに有効な認証要素がある場合、このエンドポイントを使用するには、`enroll` スコープを持ち、`audience` が `https://{yourDomain}/mfa/` に設定されたアクセストークンが必要です。

ユーザーに有効な認証要素がない場合は、このリクエストでアクセストークンの代わりに `mfa_required` エラーの `mfa_token` を使用できます。

認証要素を追加した後は、検証する必要があります。認証要素を検証するには、`/mfa/challenge` エンドポイントから返される値の代わりに `/mfa/associate` リクエストのレスポンス値を使用し、検証フローを続行します。

認証要素が初めて追加されたときは、レスポンスに `recovery_codes` フィールドが含まれます。上記の [リカバリーコードで検証する](/ja/multi-factor-authentication/verify-with-recovery-code) に示すように、`recovery_codes` を使用して多要素認証 (MFA) を完了できます。

このエンドポイントにアクセスするには、Authorization ヘッダーに次のクレームを含むアクセストークンを設定する必要があります。

* `scope`: `enroll`
* `audience`: `https://{yourDomain}/mfa/`

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

<ParamField body="client_id" type="string" required>
  アプリケーションのクライアントIDです。
</ParamField>

<ParamField body="client_assertion" type="string">
  アプリケーションの認証情報を含む署名付きアサーションを格納した JWT です。アプリケーションの認証方式が Private Key JWT の場合に必須です。
</ParamField>

<ParamField body="client_assertion_type" type="string">
  値は `urn:ietf:params:oauth:client-assertion-type:jwt-bearer` です。アプリケーションの認証方式が Private Key JWT の場合に必須です。
</ParamField>

<ParamField body="client_secret" type="string" required>
  アプリケーションのクライアントシークレットです。Application Settings の Token Endpoint Authentication Method フィールドが `Post` または `Basic` の場合に必須です。
</ParamField>

<ParamField body="authenticator_types" type="array" required>
  値は、`otp` または `oob` を要素とする配列です。
</ParamField>

<ParamField body="oob_channels" type="array">
  `authenticator_types` に `oob` が含まれる場合は必須です。
</ParamField>

<ParamField body="phone_number" type="string">
  SMS または Voice に使用する電話番号です。`oob_channels` に `sms` または `voice` が含まれる場合に必須です。
</ParamField>

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

<ResponseSchema>
  <ResponseField name="oob_code" type="string">
    帯域外認証に使用する code です。
  </ResponseField>

  <ResponseField name="binding_method" type="string">
    バインディング方式を示します。
  </ResponseField>

  <ResponseField name="authenticator_type" type="string">
    認証要素の種類です。
  </ResponseField>

  <ResponseField name="oob_channels" type="string">
    認証要素が使用する OOB チャネルです。
  </ResponseField>

  <ResponseField name="recovery_codes" type="array">
    Auth0 がユーザー用に生成する回復コードの配列です。ユーザーが認証要素を追加すると、回復コードは一度だけ表示されます。
  </ResponseField>
</ResponseSchema>

<div id="response-messages">
  ## レスポンスメッセージ
</div>

| Status | Description                        |
| ------ | ---------------------------------- |
| 200    | 認証器の追加に成功した場合のレスポンス。               |
| 400    | 必須パラメーターが不足しているか、無効なための不正なリクエスト。   |
| 401    | 未認証。アクセストークンまたは `mfa_token` が無効です。 |
