Skip to main content
All CollectionsEnterpriseTechnical SetupIntegrations
Install and configure the Slack Integration
Install and configure the Slack Integration

How to integrate Slack with Stack Overflow for Teams Enterprise.

Jamie Lowery avatar
Written by Jamie Lowery
Updated today

Tags | Slack | Integrations |

Applies to: Enterprise

ADMIN PRIVILEGES REQUIRED

This documentation is for Stack Overflow for Teams Enterprise. Free, Basic, and Business users can access their documentation here. Find your plan.


Overview

Stack Overflow for Teams Enterprise (SOE) offers a simple method to create or update a Slack integration using an app manifest. A manifest holds the configuration details of a Slack integration "bot". SOE generates this manifest, then Slack imports it and creates the bot. This simplifies the setup process and reduces errors.

THIS ARTICLE APPLIES TO STACK OVERFLOW FOR TEAMS ENTERPRISE ONLY.
Other Stack Overflow for Teams users should read this article instead. Find your plan.

Interactive Slack bot

Enabling two-way communication with the Slack servers may require you to reconfigure your firewall. Slack varies their IP addresses, making a simple IP whitelist ineffective. Instead, you can set up a reverse proxy to allow incoming connections only to the /integrations/slack/ routes. These include /integrations/slack/commands, /integrations/slack/events, and /integrations/slack/actions.

Prerequisites

Before setting up a Slack integration, it's important that:

  • You’re signed into the Slack workspace you'll integrate SOE with.

  • You’re allowed to create apps in your Slack workspace. This is Slack’s default setting, but your workspace admin can disallow it.

  • Your SOE server has a valid SSL certificate installed from a reputable certificate authority (CA).

  • You've established two-way communication between SOE and Slack (if you're creating an interactive bot).

Bot install/upgrade process

If you're creating a new Slack bot, go to the Slack API page and create a new bot from scratch. Then follow the steps below. If you're updating an existing bot, open the Slack bot you've already created. Follow the steps below, but skip steps where you don't need to make changes.

Configuring a Slack bot requires multiple steps in both Slack and SOE. We recommend having both sites open in separate browser tabs or windows.

As an SOE admin, click Admin Settings in SOE's left-hand menu. Then click Slack. In a separate browser tab or window, go to your Slack bot.

With a new bot created or an existing bot opened:

  1. In Slack's "OAuth Tokens & Redirect URLs" section, click Add New Redirect URL.

  2. Enter your site's URL.

  3. Click Add.

  4. Click Save URLs.

  5. Switch to the Slack bot's "Basic Information" section.

  6. Copy the App ID value from Slack to SOE.

  7. Copy the Client ID value from Slack to SOE.

  8. Click Show in the Client Secret field, then copy the Client Secret value from Slack to SOE.

  9. Click Show in the Signing Secret field, then copy the Signing Secret value from Slack to SOE.

  10. Click Save Credentials on SOE.

In SOE, configure the following required options for your Slack bot:

  • Enable two way communication Enable this so the interactive bot can search SOE from Slack, create new questions from Slack, and unfurl SOE links.

  • Automatically join public channels Enable this to allow the bot to automatically join public Slack channels on the workspace.

NOTE: The Automatically join public channels option is convenient, but will generate a notification for every public channel in your workspace when the bot is initially created. After that, the bot will generate an alert as it joins each newly-created public channel. Though it can be noisy for Slack workspaces with many public channels, we recommend you enable this option.

Private channel notifications, private SOE Teams

Several Slack integration options address the use of private Slack channels and private SOE Teams. Understanding these options will help ensure a successful Slack integration.

Automatically map users on Slack and Stack Overflow Enterprise
The Slack integration maps (connects) Slack and SOE user accounts based on their email address. This option allows the integration to automatically search for email addresses to connect accounts. This automatic mapping can cause a security risk with private Teams, so it's disallowed by SOE in certain configurations (see below).

Allow the bot to access basic info for private Slack channels it is a member of
Enable this option if using private channel notifications (it's off by default).

This option allows the bot to view basic info about private Slack channels in order to support private notifications. The bot can access only the private channels you've added it to, and only those channels' names. With this option disabled, users will not see channel names when adding channels for private notifications. Instead, users will see the channel ID (for example: "Private channel (G017HAH2RAT)").

Allow users to create notifications against private Teams from within Slack
This option gives Slack permission to access private teams in SOE, so it only applies if you're using private Teams. This option is off by default.

With this option enabled for an SOE integration with Private Teams, the /stack notify command allows users to choose to receive notifications from the main SOE site or any private team they're a part of. This requires users to map (connect) their Slack account to their SOE account by email address. Slack will prompt users to perform this mapping when required.

NOTE: Because of security concerns with mis-mapped email addresses and private Teams, you can't enable the Allow users to create notifications against private Teams from within Slack and Automatically map users on Slack and Stack Overflow Enterprise options at the same time.

Below are the required configuration settings if you're using private Slack channels, SOE Private Teams, or both.

Option

Slack private channels only

SOE private Teams only

Private channels and private Teams

Private channel notifications

Enable

Disable

Enable

Allow bot to access private Slack channel info

Enable

Disable

Enable

Automatically map users

Enable

Disable

Disable

Notifications against private Teams

Disable

Enable

Enable

Import the manifest into Slack

With all integration options set, follow the directions on the SOE Slack integration page to generate a manifest, import it into Slack, and install your Slack integration. This completes the bot integration setup process.

Manage the Slack integration

Once you've installed the Slack integration, click Admin settings then Slack for additional configuration options.

Slack workspaces

Slack workspaces allow customers with org-wide installs to integrate their SOE instance with Slack Enterprise Grid (one or multiple workspaces). This area of the admin screen lists existing workspaces. Click Add grid or workspace to create a new workspace connection. Click any workspace's Remove link to remove it.

Click Clear workspace cache to reset the connection when the Slack workspace name has changed and the old value is still cached by SOE. Click Rotate Slack secrets to change the secret values of your Slack app without reinstalling the integration.

Permissions for creating Slack webhooks

Specify which roles are allowed to create Slack webhooks (notifications) by selecting the appropriate radio button. Changing this setting doesn’t remove any active Slack webhooks—it only controls who can create new webhooks.

Permissions for editing Slack webhooks

Specify if all users—or just admins—should be able to view and edit all Slack webhooks (notifications) on your SOE instance. If set to Admins only, users and moderators will be able to edit only their own webhooks.

Weekly digest reset

The Slack weekly digest is on by default for all new and existing Slack notifications. Click Reset to turn off the weekly digest for all users that did not explicitly enable it. Users can enable or disable the weekly digest on individual Slack notifications.

Reconfiguring your Slack application

If you're experiencing issues with your Slack integration or want to reconfigure your Slack app, you can generate a new manifest from SOE and use it to update your Slack app. Follow the directions provided to make these changes.

Did this answer your question?