Corsair
PluginsSlack

Get Credentials

Step-by-step instructions for obtaining Slack credentials

This guide walks you through obtaining all required credentials for the Slack plugin.

Authentication Methods

The Slack plugin supports two authentication methods:

  • api_key (default) - Bot token authentication
  • oauth_2 - OAuth 2.0 user authentication

API Key Authentication (Bot Token)

Step 1: Create a Slack App

  1. Go to api.slack.com/apps
  2. Click Create New App
  3. Choose From scratch
  4. Enter your app name and select your workspace
  5. Click Create App

Step 2: Configure Bot Token Scopes

  1. In your app settings, go to OAuth & Permissions in the left sidebar
  2. Scroll to ScopesBot Token Scopes
  3. Add the required scopes:
    • channels:read - View basic information about public channels
    • channels:write - Manage public channels
    • chat:write - Send messages
    • files:read - View files shared in channels
    • files:write - Upload, edit, and delete files
    • users:read - View people in a workspace
    • reactions:write - Add and remove emoji reactions
    • Add any other scopes your application needs

Step 3: Install App to Workspace

  1. Scroll to the top of the OAuth & Permissions page
  2. Click Install to Workspace
  3. Review the permissions and click Allow

Step 4: Copy Bot Token

  1. After installation, you'll be redirected back to OAuth & Permissions
  2. Under OAuth Tokens for Your Workspace, find Bot User OAuth Token
  3. Click Copy to copy the token (starts with xoxb-)
  4. Store this token securely

Storing Credentials:

Store the bot token with the Corsair CLI:

pnpm corsair setup --slack bot_token=xoxb-your-bot-token

Verify it was saved:

pnpm corsair auth --plugin=slack --credentials

OAuth 2.0 Authentication

Step 1: Create a Slack App

  1. Go to api.slack.com/apps
  2. Click Create New App
  3. Choose From scratch
  4. Enter your app name and select your workspace
  5. Click Create App

Step 2: Configure OAuth Settings

  1. Go to OAuth & Permissions in the left sidebar
  2. Under Redirect URLs, click Add New Redirect URL
  3. Add your OAuth redirect URL (e.g., https://yourapp.com/auth/slack/callback)
  4. Click Save URLs

Step 3: Get Client Credentials

  1. Scroll to App Credentials section
  2. Copy the Client ID and Client Secret
  3. Store these securely

Storing Credentials:

Store your OAuth app credentials, then start the flow:

pnpm corsair setup --slack client_id=your-client-id client_secret=your-client-secret
pnpm corsair auth --plugin=slack

The CLI will print an authorization URL — open it in a browser. Once you approve, tokens are saved automatically.

Webhook Signing Secret

Step 1: Enable Event Subscriptions

  1. In your Slack app settings, go to Event Subscriptions in the left sidebar
  2. Toggle Enable Events to On
  3. Enter your Request URL (e.g., https://yourapp.com/api/webhook)
  4. Slack will send a verification request - ensure your endpoint handles it

Step 2: Subscribe to Bot Events

  1. Scroll to Subscribe to bot events
  2. Click Add Bot User Event
  3. Add events you want to receive:
    • message.channels - Messages posted to channels
    • channel_created - A channel was created
    • reaction_added - A reaction was added
    • team_join - A new member joined
    • user_change - A user's profile was updated
    • file_created - A file was created
    • file_public - A file was made public
    • file_shared - A file was shared

Step 3: Get Signing Secret

  1. Scroll to the top of the Event Subscriptions page
  2. Under Signing Secret, click Show and copy the secret
  3. Store this securely

Storing Credentials:

Store the signing secret with the CLI:

pnpm corsair setup --slack webhook_signature=your-signing-secret

Required Credentials Summary

CredentialRequired ForWhere to Find
Bot Token (xoxb-...)API Key authOAuth & Permissions → Bot User OAuth Token
Client IDOAuth 2.0OAuth & Permissions → App Credentials
Client SecretOAuth 2.0OAuth & Permissions → App Credentials
Signing SecretWebhooksEvent Subscriptions → Signing Secret

For general information about how Corsair handles authentication, see Authentication.