> ## Documentation Index
> Fetch the complete documentation index at: https://generaltranslation.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 認証

export const Button = ({href, children}) => {
  return <div className="not-prose group">
    <a href={href}>
      <button className="flex items-center space-x-2.5 py-1 px-4 bg-primary-dark dark:bg-white text-white dark:text-gray-950 rounded-full group-hover:opacity-[0.9] font-medium">
        <span>
          {children}
        </span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

X API は膨大な量のデータを処理します。このデータを開発者とユーザーの双方にとって安全に保つために用いられるのが、認証です。認証にはいくつかの方法があり、以下にそれぞれを挙げます。

ほとんどの開発者は、認証にまつわる複雑さに対処する必要はありません。クライアントライブラリがこれらの処理を自動的に行うためです。

利用可能なクライアントライブラリの一覧は、[Tools and libraries](/ja/resources/tools-and-libraries) ページで参照できます。

<div id="authentication-methods">
  ## 認証方法
</div>

<CardGroup cols={2}>
  <Card title="OAuth 1.0a ユーザーコンテキスト" href="/ja/resources/fundamentals/authentication/oauth-1-0a/api-key-and-secret">
    OAuth 1.0a を使用すると、認可された X の開発者 App が、非公開アカウント情報へアクセスしたり、X アカウントに代わって X 上でアクションを実行したりできます。

    <br />

    [**詳細はこちら**](/ja/resources/fundamentals/authentication/oauth-1-0a/api-key-and-secret)
  </Card>

  <Card title="App only" href="/ja/resources/fundamentals/authentication/oauth-2-0/overview">
    App only Access Token を使用すると、X の開発者 App が X 上で公開されている情報にアクセスできます。

    <br />

    [**詳細はこちら**](/ja/resources/fundamentals/authentication/oauth-2-0/overview)
  </Card>

  <Card title="ベーシック認証" href="/ja/resources/fundamentals/authentication/basic-auth">
    多くの X のエンタープライズ向け API では、HTTP ベーシック認証の使用が必要です。

    <br />

    [**詳細はこちら**](/ja/resources/fundamentals/authentication/basic-auth)
  </Card>

  <Card title="OAuth 2.0 Authorization Code Flow with PKCE" href="/ja/resources/fundamentals/authentication/oauth-2-0/authorization-code">
    OAuth 2.0 ユーザーコンテキストでは、別のアカウントに代わって認証を行うことができ、アプリケーションのスコープをより細かく制御できるほか、複数のデバイス間にまたがる認可フローも利用できます。

    <br />

    [**詳細はこちら**](/ja/resources/fundamentals/authentication/oauth-2-0/authorization-code)
  </Card>
</CardGroup>

<Note>
  **注:**
  App の API キーと App only Access Token に加えて、あなたの個人用 Access Token と Access Token Secret は、[開発者コンソール](/ja/resources/fundamentals/developer-portal) 内の [X developer Apps](/ja/resources/fundamentals/developer-apps) セクションから取得できます。

  **別のユーザーに代わってリクエストを送信したい場合**は、そのユーザー用に [3-legged OAuth flow](https://developer.x.com/resources/fundamentals/authentication/obtaining-user-access-tokens) を使って別の Access Token のセットを生成し、そのユーザーのトークンを OAuth 1.0a ユーザーコンテキストまたは OAuth 2.0 ユーザーコンテキストのリクエストに含める必要があります。
</Note>

<div id="additional-resources">
  ## その他のリソース
</div>

<CardGroup cols={2}>
  <Card title="ガイド" href="/ja/resources/fundamentals/authentication/guides">
    トークンの生成方法やリクエストの認証方法を、連携ガイドで学びましょう。
  </Card>

  <Card title="APIリファレンス" href="/ja/resources/fundamentals/authentication/api-reference">
    認証エンドポイントに関するリファレンスガイドを確認してください。
  </Card>

  <Card title="ベストプラクティス" href="/ja/resources/fundamentals/authentication/guides/authentication-best-practices">
    アカウントやデータを保護し、キーやトークンの保存に関するベストプラクティスを理解しておきましょう。
  </Card>

  <Card title="FAQ" href="/ja/resources/fundamentals/authentication/faq">
    ご不明な点がある場合は、FAQをご覧ください。
  </Card>
</CardGroup>
