Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting not_allowed_token_type error using Bot Oauth token #584

Closed
4 of 9 tasks
divyatman opened this issue Dec 24, 2019 · 7 comments
Closed
4 of 9 tasks

Getting not_allowed_token_type error using Bot Oauth token #584

divyatman opened this issue Dec 24, 2019 · 7 comments
Labels
question M-T: User needs support to use the project

Comments

@divyatman
Copy link

Description

I am following this tutorial and am getting the following error. I am also printing my BOT Token fetched from the environment variable and it is matching what I see in my Slack console for Bot User OAuth Access Token

slack.errors.SlackApiError: The request to the Slack API failed.
The server responded with: {'ok': False, 'error': 'not_allowed_token_type'}

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

slackclient version:
2.5.0
python version:
3.7.6
OS version(s):

Steps to reproduce:

  1. Setup the files as described in the tutorial
  2. Set environment variable with your bot user Oauth access token
  3. Run app.py file

Expected result:

Bot to receive events and run

Actual result:

Getting the not_allowed_token_type error

Attachments:

@confiq
Copy link

confiq commented Dec 27, 2019

ohh, if you by accident update your app, you will get the exactly same error

@sujansonly
Copy link

is this resolved ? when can i look for the solution for this problem?

@stevengill
Copy link
Member

Hey @sujansonly,

RTM isn't supported for the new granular scopes. We recommend using events API instead with the new scope. Checkout our tutorial for an example of it in action.

If you still need to use RTM, you can instead create a classic slack app

@usubram
Copy link

usubram commented Jun 15, 2020

Hello awesome folks from slack!! With RTM deprecated what is the alternative for the below usecase?

  • With Event a bot solution is forced to go to public
  • The data being fed to the bot is not public for events api to access.
  • Not all usecase in the organization requires distributed apps.
  • There is no way in Web api to push a message to bot and receive response back.

i'm wondering why slack had to deprecate a way which would completely block a way of working with a bot and want everyone to deal with exposing their apis casing security concerns, firewall.

@SamMatzko
Copy link

@stevengill

RTM isn't supported for the new granular scopes. We recommend using events API instead with the new scope.

I'm getting this same error message, and I'm not using the RTM API (as far as I know); I'm using the Events API (as you suggest) with Socket Mode. Why is that? Does the Events API require use of the RTM API as well? Why did my bot only break three years after this change was implemented? Or is there some other unrelated error that somehow popped up out of nowhere?

I don't really know much about this, so please tell me what you need to know to answer these questions, and I'll provide the information. Perhaps I should create a new issue?

@srajiang
Copy link
Member

srajiang commented Jul 18, 2022

@SamMatzko Hi Sam! Yep, it would be good to create a new issue, including details on your app setup - which APIs used, when you notice the error, any other logs that might be helpful in diagnosing.

Events API doesn't require use of the RTM API. We recommended it as a replacement for RTM in all but the most narrow use cases.

@SamMatzko
Copy link

@srajiang Okay, thanks! I'll write an issue as soon as I get the time.

@srajiang srajiang added the question M-T: User needs support to use the project label Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question M-T: User needs support to use the project
Projects
None yet
Development

No branches or pull requests

7 participants