@-mentionable groups, also called subteams). Once connected, Opal syncs the user groups and members in your Slack workspace and can add or remove members on your behalf. This supports the following, and more:
- Users can request time-bounded access to your Slack user groups.
- Reviewers can run access reviews to periodically confirm who has access to each group.
- All membership changes are tracked in a permanent audit log.
This is separate from the Slack productivity integration, which sends Opal notifications to Slack. The two are configured independently, and you can use either or both.
Requirements
- You must be an Opal administrator.
- Be on version 1.1170 or later, if you self-host Opal.
- You need a Slack app that you can configure and install. You’ll supply its OAuth client ID and secret to Opal.
- The person who authorizes the connection must be able to install the app and manage user groups in Slack. On Enterprise Grid, you can install the app org-wide to sync every workspace in the grid, or install it in a single workspace.
- Your Slack workspace must allow all members to create and edit user groups, rather than restricting this to admins and owners only. See the note below for why this is required.
Slack’s
usergroups.users.update API method, which Opal’s bot token uses to add and remove user group members, requires the calling identity to have permission to manage user groups in the workspace. If your workspace restricts creating, disabling, or modifying user groups to admins and owners only, the bot token will not have this permission, and Opal will be unable to manage (create, or update the membership of) your Slack user groups.To allow the integration to manage user groups, a workspace owner or admin should go to Tools & settings > Workspace settings > Permissions > User Groups in Slack, and set who can create, disable, or modify user groups to All members rather than Admins and owners.1. Create a Slack app and bot token
In the Slack API dashboard, create a new app (or use an existing one). Navigate to the OAuth & Permissions section in the Slack app configuration page, and add a Redirect URL that points to Opal, in the formathttps://<opal_url>/callback/slack-connection.
Under OAuth & Permissions, add the following Bot Token Scopes:
Then install the app. You can install it to a single workspace, or org-wide on Enterprise Grid. Note the app’s Client ID and Client Secret from the Basic Information page — you’ll enter these in Opal.
2. Create the Slack app in Opal
- Go to the Inventory page and click + App.
- Select the Slack app.
- Fill out the form: enter an App name, select an App admin to own the app in Opal. You can also add an optional Description (shown to people requesting access) and set the app’s Visibility.
- Click to create the app.
On Enterprise Grid, an org-wide install syncs every workspace in the grid. A single-workspace install syncs only that workspace.
What Opal syncs
- Users — workspace members that Opal can manage. Opal does not ingest deactivated accounts, bots, app users, the workspace Slackbot, or any user without an email address (Opal needs the email to match Slack users to Opal users).
- User groups — all user groups in the workspace, along with their members. Each group’s
@-handle is shown in its Opal description so you can tell how it’s mentioned in Slack.
See changes made in Slack right away
By default, Opal picks up user group membership changes made directly in Slack on its next scheduled sync. If you self-host Opal (version 1.1256 or later), Opal can instead re-sync a user group as soon as Slack reports that its members changed. To turn this on, update the Opal Slack app that your deployment already runs:- Add the
usergroups:readBot Token Scope. - Under Event Subscriptions, subscribe to the
subteam_members_changedbot event. - Reinstall the app to your workspace.
Admin and Owner roles
On Slack Enterprise Grid, Opal can sync and manage who holds Slack’s Admin and Owner roles, so users can request them like any other access, including time-bounded grants. For example, a workspace Admin can request Owner for four hours. When the grant expires, Opal returns them to Admin instead of removing their role entirely.How Slack’s roles are organized
An Enterprise Grid organization contains one or more workspaces, and each layer has its own roles:- Org roles apply to every workspace in the organization. They cover organization-wide settings such as security policies, creating workspaces, and managing other org admins.
- Workspace roles apply only to the workspace where they’re held. A user can be an Owner in one workspace and a regular member in another.
Regular members and guests don’t hold a role. Workspace membership comes from your identity provider, so Opal doesn’t manage it here.
Org roles carry down to workspaces. When someone gets an org role, Slack also makes them an Owner of every workspace they already belong to. It doesn’t add them to other workspaces. When Opal removes their org role, it also makes them a regular member of those workspaces, so a temporary org role doesn’t leave a permanent workspace Owner behind.
Requirements
- Your Slack connection is installed org-wide on Enterprise Grid by an Org Owner or Org Admin. Single-workspace installs can’t change roles and don’t list a Slack Organization resource.
- Your Slack app has the
admin.users:writeUser Token Scope, in addition to the bot token scopes listed in step 1. - If you self-host Opal, you’re on version 1.1257.0 or later.
Turn on role management
- In Inventory, open your Slack app and go to the Setup tab.
- Select Reconnect Slack (or Connect Slack), enter your Slack app’s Client ID and Client Secret, select Manage Admin and Owner roles, and then select Continue to Slack. Sign in to Slack as an Org Owner or Org Admin.
- Complete the Slack authorization, choosing to install to the organization.
What Opal can and can’t change
- Time-bounded grants fall back to the user’s standing role. When a temporary Owner grant expires, a user who still holds Admin goes back to Admin. Removing someone’s last role makes them a regular member.
- Primary owners can’t be requested or removed. The Primary Owner and Primary Org Owner roles can only be transferred in Slack. Opal shows who holds them, but doesn’t offer them in access requests, and reports an attempt to remove them as unsupported. Opal shows the Primary Org Owner as an Org Owner.
- Guests can’t hold roles. Granting a role to a Slack guest fails as unsupported, so a guest is never turned into a full member. Make the user a full member in Slack first.
- Org Admins and Org Owners aren’t listed as workspace Admins or Owners. Slack reports them as an Owner of each of their workspaces and doesn’t allow changing that role at the workspace level, so Opal shows only their org role. To remove their workspace access, remove their org role instead.
- A temporary org role doesn’t restore a standing workspace role. If a workspace Admin is temporarily made an Org Admin, they’re a regular member of their workspaces once the org role ends. Slack replaces their workspace role while the org role is held, so Opal can’t tell what it was. Grant the workspace role again afterward if they still need it.
- Slack is the source of truth. If someone changes a role directly in Slack, Opal picks up the change on its next sync.