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

# ファーストパーティアプリケーションとサードパーティアプリケーション

> Auth0 におけるファーストパーティアプリケーションとサードパーティアプリケーションの違いについて説明します。

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>;
};

Auth0 でアプリケーションを登録する際は、その所有者と運用主体に基づいて、ファーストパーティかサードパーティかを判断します。

* ファーストパーティアプリケーション: あなたの組織が所有し、運用するアプリケーションです。デプロイ、認証情報、動作はあなたが管理します。
* サードパーティアプリケーション: 外部の組織が所有し、運用するアプリケーションです。たとえば、パートナー、独立系開発者、AI エージェントなどが該当します。これらに対してはあなたのリソースへのアクセスを許可しますが、そのアクセスを使って何をするかをあなたが直接制御することはできません。

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  "サードパーティ" は、作成者ではなく運用管理上の区分を指します。多くの組織は、自社アプリケーションの開発を外部委託しています。たとえば、請負業者があなたのアプリケーションを構築したとしても、それだけでサードパーティになるわけではありません。重要な違いは、誰がそれをデプロイし、誰が認証情報を保持し、誰が停止できるかです。
</Callout>

Confidential/public とファーストパーティ/サードパーティは、それぞれ独立した分類です。Confidential または public は、アプリケーションの認証機能 (シークレットを保持できるかどうか) を表します。ファーストパーティまたはサードパーティは、信頼関係 (そのアプリケーションを誰が所有し、運用しているか) を表します。

ファーストパーティアプリケーションとサードパーティアプリケーションは、どちらも confidential (Regular Web App) にも public (SPA、Native) にもなり得ます。サードパーティの Regular Web App は、confidential であると同時にサードパーティでもあります。

<div id="first-party-applications">
  ## ファーストパーティアプリケーション
</div>

ファーストパーティアプリケーションは、Auth0ドメインを所有する組織または個人自身が管理するアプリケーションです。たとえば、Contoso API と、`contoso.com` にログインして Contoso API を利用するアプリケーションを作成したとします。この場合、API とアプリケーションの両方を同じ Auth0ドメインに登録するため、そのアプリケーションはファーストパーティアプリケーションになります。デフォルトでは、[Auth0 Dashboard](https://manage.auth0.com/#/applications) で作成されたすべてのアプリケーションはファーストパーティアプリケーションです。

<div id="third-party-applications">
  ## サードパーティアプリケーション
</div>

サードパーティアプリケーションは、通常、Auth0 のドメインに対する管理アクセス権を持つべきではない第三者によって管理されます。これにより、外部の事業者やパートナーは、API の背後にある保護されたリソースへ安全にアクセスできます。

たとえば、パートナー企業がサービスの情報を可視化するデータ分析ダッシュボードを構築する場合、まずそのアプリケーションを Auth0 テナントに登録し、<Tooltip tip="クライアントID: Auth0 から登録済みリソースに付与される識別値。" cta="用語集を表示" href="/ja/docs/glossary?term=client+ID">クライアントID</Tooltip> とシークレットを取得する必要があります。このアプリケーションは環境内に登録されていても、コードと認証情報を所有し運用しているのは組織ではなくパートナーであるため、サードパーティと見なされます。

[Dynamic Client Registration](/ja/docs/get-started/applications/dynamic-client-registration) を通じて作成されるアプリケーションは、すべてサードパーティアプリケーションです。Auth0 におけるサードパーティアプリケーションの詳細については、[サードパーティアプリケーション](/ja/docs/get-started/applications/third-party-applications) を参照してください。

<div id="first-party-vs-third-party-in-auth0">
  ## Auth0 におけるファーストパーティとサードパーティの違い
</div>

次の表は、Auth0 におけるファーストパーティアプリケーションとサードパーティアプリケーションの違いをまとめたものです。

|                                       | **First-party**          | **Third-party**                                                                                                                                              |
| ------------------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **API access**                        | API に設定されたアクセスポリシーに従う    | 常に明示的な[クライアントグラント](/ja/docs/get-started/applications/application-access-to-apis-client-grants)が必要                                                            |
| **Auth0 system APIs**                 | ユーザーフローでアクセス可能           | ユーザーフローではアクセス不可                                                                                                                                              |
| **User consent**                      | スキップ可能 (API で有効化されている場合) | 常に必要                                                                                                                                                         |
| **Grant types**                       | サポートされているすべてのグラントタイプ     | `authorization_code`、`refresh_token`、`client_credentials`                                                                                                    |
| **OIDC**                              | サポート対象                   | 非対応。今後のリリースで対応予定です。                                                                                                                                          |
| **Rules**                             | 実行される                    | 非対応。エラーになります。                                                                                                                                                |
| **Non-OAuth protocols** (SAML, WsFed) | サポート対象                   | 非対応                                                                                                                                                          |
| **Organizations**                     | サポート対象                   | [組織クライアントグラント](/ja/docs/manage-users/organizations/configure-organizations/configure-organization-client-grants)によるマシンツーマシンアクセスをサポート。ユーザーフローは今後のリリースで対応予定です。 |
| **クライアントID format**                   | 標準形式                     | `tpc_` プレフィックス                                                                                                                                               |
| **Connections**                       | 有効になっているすべての接続           | ドメインレベルの接続                                                                                                                                                   |

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

<div id="application-ownership">
  ## アプリケーションの所有権
</div>

アプリケーションの所有権は作成時に決まり、その後は変更できません。デフォルトでは、アプリケーションはファーストパーティとして作成され、制限が比較的少ないセキュリティ設定が適用されます。適切な[セキュリティ制御](/ja/docs/get-started/applications/third-party-applications/security-controls)が適用されるようにするには、外部の第三者が所有するアプリケーションを、Auth0 Dashboard または Management API で作成する際に、サードパーティアプリケーションとして正しく指定する必要があります。手順については、[サードパーティアプリケーションの設定](/ja/docs/get-started/applications/third-party-applications/configure-third-party-applications)を参照してください。

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  アプリケーションの所有権は変更できません。サードパーティアプリケーションをファーストパーティに変更することも、その逆を行うこともできません。
</Callout>

<div id="check-application-ownership">
  ## アプリケーションの所有区分を確認する
</div>

アプリケーションがファーストパーティかサードパーティかを確認するには:

<Tabs>
  <Tab title="Auth0 Dashboard">
    1. **Applications > Applications** に移動します。
    2. アプリケーションを選択します。サードパーティアプリケーションには、サードパーティ製であることを示すバッジが表示されます。

    <Frame>
      <img src="https://mintcdn.com/translations/S4csL9vq6QUX5-Rr/docs/images/third-party-applications/third-party-badge.png?fit=max&auto=format&n=S4csL9vq6QUX5-Rr&q=85&s=682354244f06a1fdeeb5cea2036e2cde" alt="サードパーティバッジが表示されたDashboardのアプリケーション設定" width="433" height="67" data-path="docs/images/third-party-applications/third-party-badge.png" />
    </Frame>
  </Tab>

  <Tab title="Management API">
    [Get a Client endpoint](https://auth0.com/docs/api/management/v2#!/Clients/get_clients_by_id)に`GET`リクエストを送信します。`{YOUR_CLIENT_ID}`と`{YOUR_MANAGEMENT_API_ACCESS_TOKEN}`のプレースホルダー値を、それぞれ<Tooltip tip="クライアントID: Auth0に登録されたリソースに付与される識別値。" cta="用語集を見る" href="/ja/docs/glossary?term=client+ID">クライアントID</Tooltip>とManagement APIの<Tooltip tip="アクセストークン: APIへのアクセスに使用される認可情報。不透明な文字列またはJWTの形式をとります。" cta="用語集を見る" href="/ja/docs/glossary?term=Access+Token">アクセストークン</Tooltip>に置き換えてください。

    <AuthCodeGroup>
      ```bash cURL theme={null}
      curl --request GET \
        --url 'https://{YOUR_DOMAIN}/api/v2/clients/{YOUR_CLIENT_ID}?fields=is_first_party&include_fields=true' \
        --header 'authorization: Bearer {YOUR_MANAGEMENT_API_ACCESS_TOKEN}'
      ```

      ```csharp C# theme={null}
      var client = new RestClient("https://{YOUR_DOMAIN}/api/v2/clients/{YOUR_CLIENT_ID}?fields=is_first_party&include_fields=true");
      var request = new RestRequest(Method.GET);
      request.AddHeader("authorization", "Bearer {YOUR_MANAGEMENT_API_ACCESS_TOKEN}");
      IRestResponse response = client.Execute(request);
      ```

      ```go Go theme={null}
      package main

      import (
      	"fmt"
      	"net/http"
      	"io/ioutil"
      )

      func main() {

      	url := "https://{YOUR_DOMAIN}/api/v2/clients/{YOUR_CLIENT_ID}?fields=is_first_party&include_fields=true"

      	req, _ := http.NewRequest("GET", url, nil)

      	req.Header.Add("authorization", "Bearer {YOUR_MANAGEMENT_API_ACCESS_TOKEN}")

      	res, _ := http.DefaultClient.Do(req)

      	defer res.Body.Close()
      	body, _ := ioutil.ReadAll(res.Body)

      	fmt.Println(res)
      	fmt.Println(string(body))

      }
      ```

      ```java Java theme={null}
      HttpResponse response = Unirest.get("https://{YOUR_DOMAIN}/api/v2/clients/{YOUR_CLIENT_ID}?fields=is_first_party&include_fields=true")
        .header("authorization", "Bearer {YOUR_MANAGEMENT_API_ACCESS_TOKEN}")
        .asString();
      ```

      ```javascript Node.JS theme={null}
      var axios = require("axios").default;

      var options = {
        method: 'GET',
        url: 'https://{YOUR_DOMAIN}/api/v2/clients/{YOUR_CLIENT_ID}',
        params: {fields: 'is_first_party', include_fields: 'true'},
        headers: {authorization: 'Bearer {YOUR_MANAGEMENT_API_ACCESS_TOKEN}'}
      };

      axios.request(options).then(function (response) {
        console.log(response.data);
      }).catch(function (error) {
        console.error(error);
      });
      ```

      ```php PHP theme={null}
      $curl = curl_init();

      curl_setopt_array($curl, [
        CURLOPT_URL => "https://{YOUR_DOMAIN}/api/v2/clients/{YOUR_CLIENT_ID}?fields=is_first_party&include_fields=true",
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => "",
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => "GET",
        CURLOPT_HTTPHEADER => [
          "authorization: Bearer {YOUR_MANAGEMENT_API_ACCESS_TOKEN}"
        ],
      ]);

      $response = curl_exec($curl);
      $err = curl_error($curl);

      curl_close($curl);

      if ($err) {
        echo "cURL Error #:" . $err;
      } else {
        echo $response;
      }
      ```

      ```python Python theme={null}
      import http.client

      conn = http.client.HTTPSConnection("")

      headers = { 'authorization': "Bearer {YOUR_MANAGEMENT_API_ACCESS_TOKEN}" }

      conn.request("GET", "/{YOUR_DOMAIN}/api/v2/clients/{YOUR_CLIENT_ID}?fields=is_first_party&include_fields=true", headers=headers)

      res = conn.getresponse()
      data = res.read()

      print(data.decode("utf-8"))
      ```

      ```ruby Ruby theme={null}
      require 'uri'
      require 'net/http'
      require 'openssl'

      url = URI("https://{YOUR_DOMAIN}/api/v2/clients/{YOUR_CLIENT_ID}?fields=is_first_party&include_fields=true")

      http = Net::HTTP.new(url.host, url.port)
      http.use_ssl = true
      http.verify_mode = OpenSSL::SSL::VERIFY_NONE

      request = Net::HTTP::Get.new(url)
      request["authorization"] = 'Bearer {YOUR_MANAGEMENT_API_ACCESS_TOKEN}'

      response = http.request(request)
      puts response.read_body
      ```
    </AuthCodeGroup>

    | 値                                  | 説明                                                                                                                                        |
    | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
    | `YOUR_CLIENT_ID`                   | 更新対象のアプリケーションのID。                                                                                                                         |
    | `YOUR_MANAGEMENT_API_ACCESS_TOKEN` | [Management API のアクセストークン](https://auth0.com/docs/api/management/v2/tokens) ([スコープ](/ja/docs/glossary?term=scope) `read:clients` を含むもの) 。 |

    アプリケーションがファーストパーティの場合、`is_first_party` フィールドの値は `true` になります。アプリケーションがサードパーティの場合、`is_first_party` フィールドの値は `false` になります。
  </Tab>
</Tabs>

<div id="learn-more">
  ## 詳細
</div>

* [サードパーティアプリケーション](/ja/docs/get-started/applications/third-party-applications)
* [サードパーティアプリケーション向けセキュリティ制御](/ja/docs/get-started/applications/third-party-applications/security-controls)
* [コンフィデンシャルアプリケーションとパブリックアプリケーション](/ja/docs/get-started/applications/confidential-and-public-applications)
* [ユーザーの同意とサードパーティアプリケーション](/ja/docs/get-started/applications/third-party-applications/user-consent-and-third-party-applications)
