https://linen.dev logo
Slack integration always defaults to Bot scope
# 🖥│support-forum
a
Hi there! We are currently testing Composio's Slack integration and encountering an unusual scenario. Originally, we did a first implementation with a custom Slack app, configured as a bot, with the proper permissions and so on. It worked well for our initial exploration. Now, however, we'd like to build an integration that operates at the user scope, rather than as a bot, and that's proving to be somewhat confusing. We created a new Slack app, configured its redirect URI and the user-scoped tokens for the permissions we required, while ensuring no Bot-scoped tokens were added. Similarly, we created a new Slack integration on the Composio side, deleting the one we had before, setting up the required params (client id, secrets, etc). When trying to create a connection through our app, however, we encounter a Slack error stating that the app is requesting permissions to install a bot on our workspace, but it's not currently configured with a bot, which is correct, as we didn't want to create a bot. However, we cannot find a way to set up the integration so that it uses a user scope. This is the URL currently shown in Slack's error message, in case it helps. https://WORKSPACE.slack.com/oauth?client_CLIENT_ID&scope=channels%3Ahistory+chat%3Awrite+team%3Aread+channels%3Aread+users%3Aread+reminders%3Awrite+reactions%3Aread+reactions%3Awrite&user_scope=channels%3Ahistory+channels%3Aread+users%3Aread+team%3Aread+im%3Ahistory+mpim%3Ahistory+groups%3Ahistory+groups%3Aread&redirect_uri=https%3A%2F%2Fbackend.composio.dev%2Fapi%2Fv1%2Fauth-apps%2Fadd&state=production_ID%3AagmBFvA8KEMr_apollo&granular_bot_scope=1&single_channel=0&install_redirect=&tracked=1&response_type=code&team=1 Is there something I may be missing here?
c
Hey Alessandra 👋, could you specify the Toolkit Slug you’re trying to create an integration for? Is it
SLACKBOT
or
SLACK
? For context, we have two different toolkits. Just need to make sure you are using the right one for your use case. Thanks!
a
Hi! It’s “slack”
That’s the part where it’s a bit puzzling
c
Thanks for the information. I’ll check it out and get back to you.
Could you share the screenshot of the OAuth consent screen?
a
Yes!
it's changeable of course, but the
slackbot
one starts with
slackbot-
"slack" is also sent there from the Composio API
(that's the result of us running:
Copy code
const tools = await composio.authConfigs.list();
)
c
Thanks for the confirmation Alessandra. Let me check this on my end and revert back.
a
Thank you! I’m around in case I can share more information 🙏
c
It looks like some of the scopes you’re using are configured for both
users
and
bots
. You can refer to this document to learn more about them. In your case, you can add one or more of the scopes that are configured for both types to the “**Bot Scopes**.” This should work for you. Note: Slack has a imitation of not allowing only UserScopes. Let me know if you need any help with configuring scopes, happy to help!
a
So if I add some of them to the bot, I'd still be able to generate an user-scope token?
that did allow me to connect an account (adding one of the scopes as Bot scopes)
I guess I could access the user token using the
access_token
inside the
authed_user
field inside the response instead of the
access_token
at root level (which is for a bot), but not sure if that's intended
c
Hi, Could you share your use case so I can help you better?
a
Of course. We are building a tool that allows users to have their information analyze by our system. This implies being able to read their conversations and PM in Slack. A Bot access token only has access to the channels that bot has been invited to whereas a User.type token is able to access what the user has access to. I am successfully able to do that using the
access_token
found in the
authed_user
field in the Composio’s response after connecting, but for other integrations (such as Gmail), we get the
access_token
directly from the roo. In Slack’s case, the
access_token
sent in the root level of the JSON response corresponds to a bot type (which is also what appears on Composio’s web when checking the connected account, token_type “bot” as shown above). So I’m unsure whether that’s expected and I should be using that
authed_user.access_token
in this case or if it’s something that’ll change in the future.
c
Got it, Let me check with the team and revert back on this.
a
@udaysidagana Hi Uday! Was the team able to find something about this?
@udaysidagana Hi there! Was there any update out this issue?
c
Hi Alessandra, sorry for the delay. Let me get some updates from the team and update you!
a
Thank you!
c
Hey, Our Slack Oauth app is configured in such a way that it requires both the bot + user scopes. In order to get only the user token (xoxp), you will need to configure your own Slack OAuth app with the scopes you need at:
a
Hi! That's what it currently does. I have a custom Slack OAuth app, with only user scopes + one bot scope (as instructed above, since if we don't add one, it requests it). However, the
access_token
we receive is always the bot's one, not the user's.
Based on your comment, it makes me think it shouldn't be asking me to have bot permission installed, which was the previous problem: https://discord.com/channels/1170785031560646836/1397637019789693062/1397945955432530072 Is there something I may be missing to use my custom auth? As stated above, I have already added the client id and other params in the config.
@udaysidagana Hi there! Anything I could do on my end to see what could possibly be going on? We are a bit stuck on this because of that problem. I'd be happy to explore other options/integration alternatives Composio offers in case I'm missing anything here.
a
hey, mind hopping on a quick call to troubleshoot this? https://calendly.com/composiohq/support
a
Hi there! Yeah, that should work. I'll pick some time. Thank you!
Hi @abhishekpatil4 ! Do you have an update on this?
a
Hey @alessapereyra, The team is still working on a fix for this. Since its a major change it's taking a little longer than anticipated. I'll get back to you with a concrete ETA within a day. Appreciate you following up on this!
a
Thank you, I'll be on the lookout then.
a
hey @alessapereyra, the fix is live! Can you retry and lmk if its working fine for you?
a
Oh, that's great to hear! I'll be sure to give it a try soon
It appears to have worked!