slackslack-apislack-bot

Is the slack bot access token will be same for all distributed workspace when app will be published in app directory?


I am working on a slack bot project. I have some questions about slack App Credentials, bot tokens, and app-level tokens.

  1. Are the slack app credentials like App id, Client id, Client Secret, and Signing Secret varies when I try to install my slack app on different workspaces or keep the same?
  2. Is the slack bot access token will be the same for all distributed workspaces when the app will be published in the app directory?
  3. Is the app-level token is same for all workspaces or only belong to the app?

Solution

  • Hello there and welcome to Slack app development!

    1. Your Slack app's credentials like app ID, client ID, and client secret are specific to your app and remain constant unless you regenerate any of them or create a new app container. If you're building for the public Slack app directory, your app will also have a development edition with a different set of IDs and secrets. These secrets and identifiers are how you identify to Slack that your app is your app and is entitled to work with Slack.

    2. A bot access token is specific to an installation, each workspace you install a bot user into will have a different bot access token. It's up to your app to switch contexts and use the right token based on the workspace involved in a specific interaction or invocation.

    3. The app-level token represents agency between your app and Slack and does not explicitly relate to any workspace it is installed on. It has a very limited set of use cases, but one of them allows you to connect to the Socket Mode interface for the Events API, from a perspective that includes all workspaces your app is installed on simultaneously.

    To receive a bot user token upon each workspace installation, you will need to support the OAuth token negotiation sequence. The Bolt SDKs Slack provides support OAuth.