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

# サードパーティアプリケーション

> 強化されたセキュリティ制御を適用して、サードパーティアプリケーションがAPIにアクセスできるよう設定します。

export const AuthCodeGroup = ({children, dropdown}) => {
  const [processedChildren, setProcessedChildren] = useState(children);
  useEffect(() => {
    let unsubscribe = null;
    function init() {
      unsubscribe = window.autorun(() => {
        const processChildren = node => {
          if (typeof node === "string") {
            let processedNode = node;
            for (const [key, value] of window.rootStore.variableStore.values.entries()) {
              const escapedKey = key.replaceAll(/[.*+?^${}()|[\]\\]/g, (String.raw)`\$&`);
              processedNode = processedNode.replaceAll(new RegExp(escapedKey, "g"), value);
            }
            return processedNode;
          } else if (Array.isArray(node)) {
            return node.map(processChildren);
          } else if (node && node.props && node.props.children) {
            return {
              ...node,
              props: {
                ...node.props,
                children: processChildren(node.props.children)
              }
            };
          }
          return node;
        };
        setProcessedChildren(processChildren(children));
      });
    }
    if (window.rootStore) {
      init();
    } else {
      window.addEventListener("adu:storeReady", init);
    }
    return () => {
      window.removeEventListener("adu:storeReady", init);
      unsubscribe?.();
    };
  }, [children]);
  return <CodeGroup dropdown={dropdown}>{processedChildren}</CodeGroup>;
};

export const AuthCodeBlock = ({filename, icon, language, highlight, children}) => {
  const [displayText, setDisplayText] = useState(children);
  const [copyText, setCopyText] = useState(children);
  const wrapperRef = React.useRef(null);
  useEffect(() => {
    let unsubscribe = null;
    function init() {
      if (!window.autorun || !window.rootStore) {
        return;
      }
      unsubscribe = window.autorun(() => {
        let processedChildrenForDisplay = children;
        let processedChildrenForCopy = children;
        for (const [key, value] of window.rootStore.variableStore.values.entries()) {
          const escapedKey = key.replaceAll(/[.*+?^${}()|[\]\\]/g, (String.raw)`\$&`);
          let displayValue = value;
          if (key === "{yourClientSecret}" && value !== "{yourClientSecret}") {
            displayValue = value.substring(0, 3) + "*****MASKED*****";
          }
          processedChildrenForDisplay = processedChildrenForDisplay.replaceAll(new RegExp(escapedKey, "g"), displayValue);
          processedChildrenForCopy = processedChildrenForCopy.replaceAll(new RegExp(escapedKey, "g"), value);
        }
        setDisplayText(processedChildrenForDisplay);
        setCopyText(processedChildrenForCopy);
      });
    }
    if (window.rootStore) {
      init();
    } else {
      window.addEventListener("adu:storeReady", init);
    }
    return () => {
      window.removeEventListener("adu:storeReady", init);
      unsubscribe?.();
    };
  }, [children]);
  useEffect(() => {
    if (!wrapperRef.current) return;
    const originalWriteText = navigator.clipboard.writeText.bind(navigator.clipboard);
    let isOverriding = false;
    const handleClick = e => {
      const button = e.target.closest('[data-testid="copy-code-button"]');
      if (!button || !wrapperRef.current.contains(button)) return;
      isOverriding = true;
      navigator.clipboard.writeText = text => {
        if (isOverriding) {
          isOverriding = false;
          navigator.clipboard.writeText = originalWriteText;
          return originalWriteText(copyText);
        }
        return originalWriteText(text);
      };
      setTimeout(() => {
        if (isOverriding) {
          isOverriding = false;
          navigator.clipboard.writeText = originalWriteText;
        }
      }, 100);
    };
    const wrapper = wrapperRef.current;
    wrapper.addEventListener('click', handleClick, true);
    return () => {
      wrapper.removeEventListener('click', handleClick, true);
      if (navigator.clipboard.writeText !== originalWriteText) {
        navigator.clipboard.writeText = originalWriteText;
      }
    };
  }, [copyText]);
  return <div ref={wrapperRef}>
      <CodeBlock filename={filename} icon={icon} language={language} lines highlight={highlight}>
        {displayText}
      </CodeBlock>
    </div>;
};

サードパーティアプリケーションとは、パートナー、独立系開発者、AI エージェントなどの外部組織が所有・運用し、あなたのユーザーを認証して API にアクセスするアプリケーションです。

あなたが直接管理する [ファーストパーティアプリケーション](/docs/ja-jp/get-started/applications/first-party-and-third-party-applications#first-party-applications) とは異なり、サードパーティアプリケーションは独立して動作します。リソースへのアクセスを許可することはできますが、そのアクセス権を使って何をするかを制御することはできません。ファーストパーティアプリケーションとサードパーティアプリケーションの違いについて詳しくは、[ファーストパーティアプリケーションとサードパーティアプリケーション](/docs/ja-jp/get-started/applications/first-party-and-third-party-applications) を参照してください。

サードパーティアプリケーションには、次のような固有の特性があります。

* **強化されたセキュリティ制御**: Auth0 はサードパーティアプリケーションに対して [enhanced security controls](/docs/ja-jp/get-started/applications/third-party-applications/security-controls) を適用し、外部アプリケーションが明示的に承認されたリソースにのみアクセスできるようにします。ファーストパーティのユースケース向けの機能は利用できません。
* **ユーザーの同意**: サードパーティアプリケーションが API へのアクセスを要求する場合、Auth0 は常にユーザーの同意を必要とします。同意を省略することはできません。
* **接続**: サードパーティアプリケーションは、ドメインレベルの接続を通じてのみユーザーを認証できます。詳しくは、[Promote Connections to Domain Level](/docs/ja-jp/authenticate/identity-providers/promote-connections-to-domain-level) を参照してください。
* **Organizations**: サードパーティアプリケーションは、ユーザーフローとマシンツーマシンアクセスの両方で [Organizations](/docs/ja-jp/manage-users/organizations) をサポートしています。ユーザーフローでは、organization がオプトインする必要があります。詳しくは、[Organizations アクセスを設定する](/docs/ja-jp/get-started/applications/third-party-applications/configure-third-party-applications#configure-organizations-access) を参照してください。

<div id="use-cases">
  ## ユースケース
</div>

一般的なサードパーティアプリケーションのユースケースには、次のようなものがあります。

* **パートナー連携**: 外部パートナーが、ユーザーに代わって自社のAPIを呼び出すアプリケーションを構築します。たとえば、CRMベンダーが自社のプラットフォームと連携し、共通の顧客が両製品間でデータを同期できるようにします。
* **AIエージェントとMCPクライアント**: Claude Code、Copilotを備えたVS Code、カスタムMCPサーバーなどのAI搭載ツールが、ユーザーに代わってアクションを実行するために自社のAPIに接続します。詳しくは、[Auth for MCP](https://auth0.com/ai/docs/mcp/intro/overview) を参照してください。
* **開発者エコシステム**: 開発者ポータル、マーケットプレイス、または [Dynamic Client Registration](/docs/ja-jp/get-started/applications/dynamic-client-registration) を通じて、外部開発者が自社のプラットフォーム上でアプリケーションを構築できるようにAPIを公開します。
* **Cross App Access (XAA)**: 別の組織のテナントにある従業員向けアプリケーションが、信頼関係を通じて自社のAPIにアクセスします。このとき、リクエスト元のアプリケーションは自社のテナント内でサードパーティアプリケーションとしてモデル化されます。詳しくは、[Cross App Access](/docs/ja-jp/ai-agents-mcp/cross-app-access) を参照してください。

<div id="supported-client-types">
  ## サポート対象のクライアントタイプ
</div>

サードパーティアプリケーションは、Confidential と Public の両方のクライアントタイプをサポートしています。

| **クライアントタイプ** | **アプリケーションの種類** | **ユースケース**          |
| ------------- | --------------- | ------------------- |
| Confidential  | Regular Web App | サーバーサイドのパートナー連携     |
| Public        | Single Page App | ブラウザベースのパートナーウィジェット |
| Public        | Native          | モバイル向けパートナーアプリケーション |

<div id="supported-grant-types">
  ## サポート対象のグラントタイプ
</div>

サードパーティアプリケーションでは、次がサポートされています:

* `authorization_code` (PKCE必須)
* `refresh_token`
* `client_credentials` (機密クライアントのみ)

<div id="get-started">
  ## はじめに
</div>

Auth0 でサードパーティアプリケーションを設定するには、以下の手順に従ってください。

<div id="step-1-create-the-application">
  ### 手順 1: アプリケーションを作成する
</div>

Auth0 Dashboard または Management API を使用して、[サードパーティアプリケーションを作成します](/docs/ja-jp/get-started/applications/third-party-applications/configure-third-party-applications#create-a-third-party-application)。

<div id="step-2-configure-api-access">
  ### ステップ 2: API Access を設定する
</div>

サードパーティアプリケーションが API にアクセスするには、API のアクセスポリシーが **Allow All.** に設定されている場合でも、常に明示的な認可が必要です。APIアクセスポリシーは、[クライアントグラント](/docs/ja-jp/get-started/applications/application-access-to-apis-client-grants) を通じて設定します。

すべてのサードパーティアプリケーションに自動的に適用されるデフォルト権限を設定できます。これは、多数のサードパーティアプリケーションを管理している場合や、[Dynamic Client Registration](/docs/ja-jp/get-started/applications/dynamic-client-registration) を使用している場合に便利です。詳しくは、[サードパーティアプリケーションのデフォルト権限](/docs/ja-jp/get-started/applications/application-access-to-apis-client-grants#default-permissions-for-third-party-applications) を参照してください。

また、[クライアントグラント](/docs/ja-jp/get-started/applications/application-access-to-apis-client-grants) を通じて、個々のアプリケーションに特定の権限を設定することもできます。アプリケーションごとの権限は、デフォルト権限より優先されます。詳しくは、[クライアントグラントを作成する](/docs/ja-jp/get-started/applications/application-access-to-apis-client-grants#create-client-grant) を参照してください。

<div id="step-3-configure-connections">
  ### ステップ 3: 接続を設定する
</div>

サードパーティアプリケーションは、ドメインレベルに昇格された接続を通じてのみユーザーを認証できます。ドメインレベルの接続は、テナント内のすべてのサードパーティアプリケーションで利用できます。

接続をドメインレベルに昇格する方法については、[Promote Connections to Domain Level](/docs/ja-jp/authenticate/identity-providers/promote-connections-to-domain-level) を参照してください。

<div id="step-4-users-provide-consent">
  ### ステップ 4: ユーザーが同意する
</div>

ユーザーがサードパーティアプリケーション経由で認証すると、Auth0 は、要求された権限の承認を求める同意ダイアログを表示します。サードパーティアプリケーションでは、同意は常に必須であり、スキップすることはできません。

詳しくは、[ユーザーの同意とサードパーティアプリケーション](/docs/ja-jp/get-started/applications/third-party-applications/user-consent-and-third-party-applications) を参照してください。

<div id="step-5-optional-enable-for-organizations">
  ### ステップ 5 (任意) ：Organizations で有効化
</div>

アプリケーションが organization のコンテキストでユーザーを認証する場合、または organization に代わって API にアクセスする場合は、各 organization でサードパーティアクセスを有効にします。詳細については、[Organization のサードパーティアプリケーションアクセスを有効にする](/docs/ja-jp/manage-users/organizations/configure-organizations/enable-third-party-application-access)を参照してください。

<div id="dynamic-client-registration">
  ## Dynamic Client Registration
</div>

[Dynamic Client Registration](/docs/ja-jp/get-started/applications/dynamic-client-registration) では、既定で強化されたセキュリティ制御が適用されたサードパーティアプリケーションが作成されます。サードパーティアプリケーションに対して DCR を有効にする前に、動的に登録されたクライアントが API にアクセスできるよう、[デフォルトのAPI権限を設定](/docs/ja-jp/get-started/applications/dynamic-client-registration#configure-api-access-for-dcr-clients)する必要があります。
