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

# Slack

> AI agentをSlackに接続して、チーム内のコミュニケーションとワークフローの自動化を実現します。

AI agentをSlackと連携させて、チーム内のコミュニケーションやワークフローの自動化に活用しましょう。

## SlackをAuth0に接続する

**1. Slackの設定**

<ol>
  <li>
    [Slack Developerアカウント](https://slack.com/signin)にサインアップします。
  </li>

  <li>
    まだ作成していない場合は、[Slack
    App](https://api.slack.com/apps?new_app=1)を作成します。**From scratch**
    オプションを選択し、名前を付けてワークスペースを選択します。
  </li>

  <li>
    アプリが作成されたら、**Client ID**と**Client Secret**をコピーします。
  </li>

  <li>
    左側のナビゲーションにある**OAuth & Permissions**セクションで、
    以下の操作を行います。

    <ol>
      <li>
        **OAuth Tokens**で**Token Rotation**を選択してオプトインし、アプリが
        リフレッシュトークンに対応するようにします。
      </li>

      <li>
        **Redirect URLs**で、
        `https://YOUR_AUTH0_DOMAIN/login/callback`を新しいRedirect URLとして追加します。

        You can find the **Auth0 domain** in the [Auth0 Dashboard](https://manage.auth0.com/).

        You can find this under **Applications > \[Your Application] > Settings > Basic Information > Domain**.

        If you are using the [custom domains](/docs/customize/custom-domains) feature, your Auth0 domain is the custom domain. You can find this under **Branding > Custom Domains**.
      </li>

      <li>
        **Scopes**で、アプリの動作に必要なOAuthスコープを
        追加します。
      </li>
    </ol>
  </li>
</ol>

**2. Auth0の設定**

<ol>
  <li>
    [Auth0 Dashboard](https://manage.auth0.com/)で、
    **Authentication > Social**に移動します。**Create Connection**を選択し、
    **Sign in with Slack**を選択して、**Continue**を選択します。
  </li>

  <li>
    **General**で、作成したSlack OAuthアプリの**Client ID**と**Client Secret**を
    入力します。
  </li>

  <li>
    **Purpose**で、**Connected Accounts for Token Vault**をオンにします。これにより、
    この接続で外部APIのアクセストークンを取得し、安全に保存できるようになります。詳しくは、[Connected Accounts for Token Vaultを構成する](/docs/ja-jp/secure/call-apis-on-users-behalf/token-vault/connected-accounts-for-token-vault)を参照してください。
  </li>

  <li>**Create**を選択します。</li>

  <li>
    保存したら、**Applications**タブに移動し、この接続を使用する
    アプリケーションを選択します。
  </li>
</ol>

アプリケーションで[Organizations](/docs/ja-jp/manage-users/organizations)を使用している場合は、Connected Accounts フローを開始する前に、対象のOrganizationでユーザーを認証してください。この場合も、Token VaultはSlackの連携済みアカウントをユーザーのAuth0プロファイルに保存するため、Organizationの各メンバーがそれぞれ自分のSlackアカウントを認可することになります。

このガイドでは、Auth0 で **Slack** 接続をセットアップする手順を説明します。
このような接続を使用して、ユーザーに代わってアプリから第三者 API を呼び出す方法を一連の流れで示す例については、
[ユーザーに代わって第三者 API を呼び出すクイックスタート](/ai/docs/get-started/call-third-party-apis-on-users-behalf)をお読みください。

## Token Vaultの設定例

Slack接続用にToken Vaultを設定するには、アプリケーションで次のコードスニペットを使用します。

**JavaScript**

**Python**

## Next steps

* To learn how to configure applications to access Token Vault, read [Configure Token Vault](/docs/secure/call-apis-on-users-behalf/token-vault/configure-token-vault).
* If your application uses [Organizations](/docs/manage-users/organizations), authenticate the user with the target organization before initiating the Connected Accounts flow. Connected accounts remain linked to the individual user profile.
* To learn how to get an access token to make a tool call, complete the [Call third-party APIs on user's behalf Quickstart](/ai/docs/get-started/call-third-party-apis-on-users-behalf).
