> ## 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) + "*****マスク済み*****";
          }
          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 にアクセスするアプリケーションです。

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

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

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

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

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

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

<div id="supported-client-types">
  ## サポートされているクライアントタイプ
</div>

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

| **クライアントタイプ** | **アプリケーションタイプ** | **ユースケース**          |
| ------------- | --------------- | ------------------- |
| 機密            | Regular Web App | サーバーサイドのパートナー統合     |
| パブリック         | Single Page App | ブラウザベースのパートナーウィジェット |
| パブリック         | 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 を使用して、[サードパーティアプリケーションを作成](/ja/docs/get-started/applications/third-party-applications/configure-third-party-applications#create-a-third-party-application)します。

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

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

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

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

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

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

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

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

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

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

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

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

<div id="learn-more">
  ## 詳細はこちら
</div>

* [ファーストパーティアプリケーションとサードパーティアプリケーション](/ja/docs/get-started/applications/first-party-and-third-party-applications)
* [サードパーティアプリケーション向けのセキュリティ制御](/ja/docs/get-started/applications/third-party-applications/security-controls)
* [サードパーティアプリケーションを設定する](/ja/docs/get-started/applications/third-party-applications/configure-third-party-applications)
* [サードパーティアプリケーションに対するユーザーの同意](/ja/docs/get-started/applications/third-party-applications/user-consent-and-third-party-applications)
* [サードパーティアプリケーションのトラブルシューティング](/ja/docs/get-started/applications/third-party-applications/troubleshooting)
* [APIへのアプリケーションアクセス: クライアントグラント](/ja/docs/get-started/applications/application-access-to-apis-client-grants)
