Create a Slack OAuth app for OpenConnector
Use a Slack OAuth app when OpenConnector needs to read Slack conversations, list users, send messages, upload files, or manage reactions through the slack service.
OpenConnector service
| Service ID | Provider | Auth type |
|---|---|---|
slack | Slack | OAuth2 |
OpenConnector’s Slack provider uses Slack OAuth v2 and requests Slack scopes such as channels:read, groups:read, im:read, mpim:read, history scopes, file scopes, users:read, chat:write, im:write, and reaction scopes.
Prerequisites
- A running OpenConnector runtime.
- Permission to create or manage a Slack app for the target workspace.
- Permission to install apps in the Slack workspace, or access to a workspace owner/admin who can approve installation.
- The OpenConnector origin users open in the browser, such as
http://localhost:3000orhttps://connect.example.com.
Step 1: Set the OpenConnector callback URL
Build the callback URL by appending /oauth/callback to your OpenConnector origin.
For local testing, use http://localhost:3000/oauth/callback. If Slack does not accept your local callback URL, expose OpenConnector through an HTTPS tunnel or public domain, set OOMOL_CONNECT_ORIGIN, restart, and use the public callback URL, such as https://connect.example.com/oauth/callback.
Step 2: Create a Slack app
- Create a new app.
- Choose the workspace you want to develop or test in.
- Open OAuth & Permissions.
- Add the exact OpenConnector callback URL under redirect URLs.
- Add the bot token scopes needed by your OpenConnector actions.
- Save the app settings.
Slack’s OAuth overview is Installing with OAuth, and Slack’s scope reference is Scopes.
Step 3: Copy the client credentials
Open Basic Information for the Slack app and copy:
| Slack value | OpenConnector field |
|---|---|
| Client ID | clientId |
| Client Secret | clientSecret |
Do not use the bot token as the OAuth client secret. OpenConnector starts the OAuth flow and stores the resulting Slack credential after authorization.
Step 4: Save the Slack client in OpenConnector
Use the OpenConnector web console:
- Open the OpenConnector web console, such as
http://localhost:3000. - Open Providers and select Slack.
- Choose Configure OAuth Client or Edit OAuth Client.
- Paste the Slack client ID and client secret.
- Choose Save OAuth Client.
Step 5: Connect and test
After saving the OAuth client, choose Connect on the Slack provider page. Choose the Slack workspace, approve the app, return to OpenConnector, and confirm that the provider page shows the workspace as connected.
Low-risk test actions include slack.list_conversations, slack.list_channels, and slack.list_users.
Troubleshooting
| Symptom | What to check |
|---|---|
| Slack rejects the redirect URL | Confirm the Slack redirect URL is <openconnector-origin>/oauth/callback. If Slack requires HTTPS for your setup, use an HTTPS public origin and set OOMOL_CONNECT_ORIGIN. |
| The app cannot be installed | Ask a Slack workspace owner or admin to approve the app if the workspace restricts app installation. |
| Channels are missing | Public and private channel visibility depends on scopes, Slack workspace policy, and whether the app has access to the channel. Invite the app to private channels when needed. |
| Message actions fail | Confirm the app has write scopes such as chat:write and can access the target conversation. |
| Scope changes do not apply | Reinstall or reconnect Slack after changing scopes so the connected credential receives the new permissions. |