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

> Custom Token Exchange で多要素認証 (MFA) を使用する方法を説明します。

# Custom Token Exchange での多要素認証 (MFA)

export const ReleaseStageNotice = ({feature, stage, plans, contact, terms}) => {
  const stageTextMap = {
    "beta": "ベータ",
    "ea": "早期アクセス"
  };
  const stageText = stageTextMap[stage] || "製品リリース段階";
  const prsLink = "/docs/troubleshoot/product-lifecycle/product-release-stages";
  const linkify = (text, url) => {
    return <a href={url} target="_blank" rel="noreferrer" class="link">{text}</a>;
  };
  const includeDetails = (plans, contact, terms) => {
    const hasDetails = terms || plans || contact;
    if (!hasDetails) return null;
    return <span data-as="p">
            {plans && <>この機能は、{linkify(`${plans}プラン`, "https://auth0.com/pricing")}で利用できます。 </>}
            {contact && "参加するには、" + contact + " までお問い合わせください。 "}
            {terms && <>この機能を使用すると、Okta の{linkify("Master Subscription Agreement", "https://www.okta.com/legal")}に定める該当する無料トライアル条件に同意したものとみなされます。</>}
        </span>;
  };
  return <Warning>
            <span data-as="p">
                <strong>{feature} 機能は現在、{linkify(stageText, prsLink)}です。</strong>
            </span>

            {includeDetails(plans, contact, terms)}
        </Warning>;
};

<ReleaseStageNotice feature="Custom Token Exchange (CTE)" stage="ea" plans="B2C Professional, B2B Professional, and Enterprise" terms="true" />

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  `api.authentication.setActor()` を使用して actor が設定された Custom Token Exchange のトランザクションでは、MFA はサポートされません。MFA が必要な場合 (ポリシーまたは Post-Login Action による) に、Custom Token Exchange Action で actor を設定すると、トランザクションは `400` エラー `MFA is not supported using actor_token with the requested token exchange profile.` で失敗します。
</Callout>

トークンの盗難などのセキュリティリスクに対する保護を追加するには、次のいずれかの方法で Custom Token Exchange リクエストに多要素認証を追加できます。

* テナントで [MFA ポリシーを有効にして設定する](/ja/docs/secure/multi-factor-authentication/enable-mfa)
* Post-Login Action で `api.multifactor.enable()` を使用する

MFA を追加すると、Auth0 認可サーバーは `/token` エンドポイントへの最初の Custom Token Exchange 呼び出しを `mfa_required` エラーで拒否します。[Auth0 MFA API](/ja/docs/secure/multi-factor-authentication/multi-factor-authentication-developer-resources/mfa-api) では、このエラーを使って要素のチャレンジと検証を行い、要求された Auth0 のアクセストークン、ID トークン、リフレッシュトークンを取得できます。

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  Custom Token Exchange では `api.authentication.challengeWith()` と `api.authentication.enrollWith()` はサポートされていません。これらのメソッドを Post-Login Action で使用すると、トランザクションは回復不能なエラーで失敗します。`subject_token_type` の値に応じて `event.transaction.protocol==oauth2-token-exchange` となる場合は、これらのメソッドを使用しないでください。
</Callout>

Custom Token Exchange のトランザクションが組織に関連付けられている場合、`api.multifactor.enable()` と MFA ポリシーもサポートされません。

MFA grant の使用方法について詳しくは、Custom Token Exchange は同じモデルに従うため、[MFA を使用して Resource Owner Password Flow で認証する](/ja/docs/secure/multi-factor-authentication/authenticate-using-ropg-flow-with-mfa) を参照してください。詳細な例については、[Use case: Perform MFA during Custom Token Exchange](/ja/docs/authenticate/custom-token-exchange/cte-example-use-cases#use-case%3A-perform-mfa-during-custom-token-exchange) も参照してください。
