Slack API expects token passed in Authorization header instead of a GET parameter? #204
Comments
Okay, I just created a bot through https://my.slack.com/services/new/bot instead of through https://api.slack.com/apps and I can confirm that bots created the legacy way are able to pass the |
And even though I created my legacy bot user today, it looks like {
"ok": false,
"error": "method_deprecated"
} According to this document:
I took a look and |
I'm down to take a stab at these issues, but I'm worried there's more methods I haven't tried to use yet that have been deprecated and even more confusion on what's needed for new legacy bots vs. new Slack Apps. It seems like updating everything to be fully functional for new legacy bots and Slack Apps will probably be multiple iterations of work, so I'm not sure whether you would prefer we merge fixes to master as I'm able to help work on them or if it's better to start a WIP branch and hold off merging it to master until everything's fixed. |
RIP. I just noticed that a lot of these issues are being fixed on master already. |
Hey, thanks for the great issue! I believe the RTM issue and the token issue should be fixed on the main branch like you said. If you come across any other bugs or areas for improvement, issues and PRs are always welcome! |
The code I'm running to run is simple:
I traced the
URLRequest
being sent and it seems like theurl
is:https://slack.com/api/conversations.list?token=xoxb-SLACK-BOT-TOKEN
I tried sending this same request with Postman and got this response:
But when I send a request to
https://slack.com/api/conversations.list
with the following header:it returns the expected response:
So I'm not sure why I'm the only one having the issue, but maybe it's because I created my app on the Slack Api portal yesterday and it uses this new header auth style?
If that's the case, then it looks this library needs to be updated to pass the token in the
Authorization
header for new Slack Apps.Edit: Here's the changelog where they deprecated querystring authentication: https://api.slack.com/changelog/2020-11-no-more-tokens-in-querystrings-for-newly-created-apps
The text was updated successfully, but these errors were encountered: