How to Configure Slack OAuth Scopes in Pipedream to Support Both User and Bot?

This topic was automatically generated from Slack. You can find the original thread here.

Hey @U05FUC30Q01
I’m getting an invalid_scope error when setting Slack OAuth scopes in Pipedream.
In Slack, my app has chat:write (and I can see it supports both user and bot). But when I add chat:write in the Pipedream OAuth client, I get invalid_scope. I see the same issue with chat:write.customize.
My use case: post to Slack as a user in some workflows and as a bot in others.
How should I configure the scopes in Pipedream to support both?
Thanks!

Hi , I believe you need to separate the OAuth Client. One for Slack (User) and one for Slack Bot.

That’s why Pipedream has two separate app for Slack: Slack and Slack Bot

Thanks will try that!
One thing I’m still unclear on: the error comes up specifically when adding scopes:
chat:write which slack supports when i am using this getting invalid scope error.

Hey , could you share the steps how do you setup your Slack OAuth Client?

In general, Pipedream uses Slack OAuth flow (documented here), which requires you define the scopes on both OAuth request (Pipedream), and on the Slack App.

If you see the invalid scope error with the chat:write scope, it might possibly that you forgot to add it in Pipedream or in your Slack App permission.

hey when creating this in pipedream we see that there are some deprecated scopes being used. is the current slack module up to date on scopes?

i work with

Hey , are you using Pipedream OAuth client for Slack? Or your own Custom OAuth client for Slack?

custom auth

You define your own scopes for custom auth — which Pipedream will use it as is to request oauth token from Slack

Hey The issue we are facing is these are the scopes we have configured in our slack app

channels:history channels:read channels:write
chat:write files:read files:write links:read links:write users:read

now when we are configuring same in the pipedream oauth client then after adding chat:write we are getting invalid scope error and i checked in pipedream it is using chat:write:user so i am using this instead of chat:write then invalid_scope error resolves but then we are getting account connection failed

Hey , let’s make a little step back. Why do you need to use custom oauth client? What you want to achieve?

Hey we are running workflows created in the UI for the external users.
so in the workflow there is a step to send a message to a particular slack channel selected by the external user.

we are using custom oauth client as we were unable to run workflows for the external user without using custom oauth.
Here is the link to discussion happened earlier regarding same: Slack

Hey , thanks for your information.

We observed connection errors for your Slack account in the flockx-new workspace. The issue appears to be related to the configuration of your custom Slack OAuth app.
To resolve this, please review the following in your Slack app’s settings:

  1. Permissions: Add the users.profile:read scope. The connection failed due to this missing scope.
  2. Redirect URI: Ensure the Redirect URI in your app’s configuration exactly matches the one provided by Pipedream. We detected a bad_redirect_uri error.
  3. Credentials: We also received a bad_client_secret error. Please verify your Client ID and Client Secret are correct and re-enter them in Pipedream.
    After updating these settings, please attempt to reconnect your account. Let us know if the issue persists.

Thank you , will look through all these and try again.

Hey Thanks for the help, this users.profile:read thing worked for me.
also just for the information there isn’t any chat:write:user in slack as it moved to chat:write as in whole for both user and bot.
But in pipedream it is working with chat:write:user.

Also one quick question when deploying a slack-new-message-channel trigger using the deploy api is there is any way i could filter the incoming events based on the text type?
what i want is to get the event trigger only for the message that have a URL in it.

Hi , you can use the Filter action here: Filter - Pipedream

Thank you for the help , will try this.

Hey I was hoping if you share the doc for the schema’s to include while deploying different type of triggers.
I tried looking at it but didn’t find much it would be a great help.
Like google_sheets-new-row-added gmail-new-mail-recieved
like in trigger what to include to get rid of past events in these!