-
Notifications
You must be signed in to change notification settings - Fork 663
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
Cannot start rtm client by providing valid xoxb token, the error shown not_allowed_token_type
#921
Comments
not_allowed_token_type
not_allowed_token_type
not_allowed_token_type
not_allowed_token_type
EDIT: I just saw your screenshot so I see that you're app is in fact granular bot permissions instead of a regular app 😓Only the second part of this comment is relevant for you @zhang699 Hey there 👋 I found one possible problem, but this may be a little confusing (sorry in advance 😅). When I created a regular Slack app, this code worked fine for me and I didn't get any errors. "Regular" Slack apps, in this case, are apps that do not use granular bot permissions. To tell if your app uses granular bot permissions you can go to the App Management, click on your app, then OAuth & Permissions on the sidebar. If your app has a However, my guess is that your app is using a granular bot permissions app. I was able to reproduce the error using this token. If your app uses granular bot permissions, the OAuth & Permissions page will look like this instead: Unfortunately, granular bot permissions apps do not support the RTM API, since it requires the If this doesn't fix your problem, let me know and I can look into it further. |
thanks @shaydewael :) , it fixed my problem, I have recreated the app, the bot scope appeared. and the I don't know how was I create could you give me steps to create granular bot permissions app? |
You can create a GBP app from https://api.slack.com/apps?new_granular_bot_app=1 |
I had an app that had the bot scope, and then I changed the permissions and must have changed it to use granular permissions. How do I revert it back to using just the bot scope without creating a new app so I can use the RTM API again? |
I'm in same boat as @zisadlier ^ EDIT: Talked with slack support, you can't change the app to be classic! |
In general @confiq is right. Don't update scopes for an app that is using RTM, it will make your app stop working. If you accidentally update scopes, the recommended path forward is to update your app to use the Events API. We acknowledge that in some cases updating to use the Events API is impossible or impractical since that requires your app to be reachable via a public URL. In these cases, read on. There is a way to convert your installation back. It's complicated, and will make managing your app much harder in the future, so don't go down this route unless its necessary. If you have many users already using your app, so creating a new app isn't an option, then this conversion back to a regular app likely makes sense. In order to convert your app back to a regular Slack app, you need to first configure OAuth. In the app configuration, choose the "OAuth & Permissions" page. If you haven't already, add a "Redirect URL". If you cannot create a public URL for your app, you can use a "localhost" URL for OAuth purposes. For example, you can set the Redirect URL to Next, you need to add code in your app to handle the OAuth redirect. Please read the OAuth documentation to understand how the OAuth flow works. Following the example above, you'll need to start an HTTP server on port 3000, which handles requests to the path Then, you'll need to visit the installation URL for your app. Typically this is done by clicking the "Add to Slack" button created for your app. As a shortcut, if you know which scopes your app needs and your client ID, you can create the URL yourself. Following the example, we would use Now you should see Slack asking you permission to install the app in your workspace. Make sure its the right workspace and use the toggle in the upper right side of the screen if it isn't. Once you authorize the installation, the browser will redirect to the OAuth Redirect URL you set previously, which your app will handle by calling However, when you use the Slack app configuration pages you will continue to see the updated scopes, which will be incorrect. If you ever need to update the scopes, you'll have to build a new installation URL manually, visit it, and finish the installation as shown above. The |
I think we've gotten to the bottom of this issue, so I'm going to close. We can do a better job documenting the cases that got brought up here, so I created the issue above to track that work. Feel free to comment if this or a related concern comes up again! |
If the RTM API will no longer be usable on new apps, would it be possible to put a deprecation notice on this documentation? As is, it is very misleading. |
Do you have a specific reason why slack would you deprecate RTM API? |
@ChrisDoohan we haven't officially deprecated RTM. We do want app developers to be using the events api over RTM, but RTM still handles some use cases that events api doesn't (mainly working behind strict corporate firewall policies) At the bottom of the page you link, it includes a Create a Classic Slack APP section that allows you to create an app that works with RTM. |
Just upgraded and my app died. I really think you should have a better notice about the consequence of upgrading!! This user xp is bad... |
@stevengill I'm struggling to find any info on the future of the RTM API. You say it isn't being deprecated, but the new GBP model doesn't support it, and only GBP based apps will be allowed from the 21st of Feb. Since the Events API doesn't provide some of the functionality in the RTM API, it looks like my app is about to fall off a cliff. |
Hey @amilbourne, it sounds like existing RTM apps that are already on the App Directory can continue publishing until Dec 1st, 2020. If you’re not distributing to the App Directory, like for a custom app just in your organization, the deadline doesn’t apply. Would it be possible for you to share which features of RTM you are using that aren't available in with the Events API currently? |
@KeesCBakker I totally understand and empathize with your issue. I've gone ahead and shared this thread with the team in charge of the api site so they can take a closer look at the existing experience on the upgrading flow. |
Can we know the technical reason why there is no |
Hey @confiq, Granular bot permissions is a solution for apps which don’t need all the access granted by the There are some other benefits of shifting API usage from user tokens to bot tokens: it allows developers to manage fewer, non-redundant bot tokens; bot users remain in the team after the initial installing user leaves which is better for continuity. From a purely technical point of view, the Are you building an app that will be distributed on the App Directory and currently using RTM? If so, let’s chat directly so I can understand your needs and use case a little better. If not, you should be able to continue to use a classic app for the foreseeable future. You can find me (steve gill) on the community workspace in the #slack-api channel. |
@stevengill I could rewrite the app in the events API at a push but RTM provides some stuff that makes it much easier to use. The primary feature is that messages arrive in order. It is also useful that it uses an outgoing connection which side-steps issues with corporate firewalls. The feeling I'm getting at the moment is that Slack didn't realise that there would be a problem with the RTM API, and are now trying to decide what to do about it. Hence lots of mixed messages on ts future. |
@amilbourne I believe even for RTM, messages don't arrive in order. Slack was aware that RTM would not be supported by Granular permissions. It is referenced in our migration guide |
For others ending up in this thread trying to find how to create a classic app with
|
ok, can we have |
Link to a blog post they provided about the update: https://medium.com/slack-developer-blog/more-precision-less-restrictions-a3550006f9c3 |
This "Events API" is terrible. Is there a new websockets endpoint available rather than having to host a freaking web server in order to receive events?! Slack: "Don't call us, we'll call you" |
It's hard to know wether we can use a user token (xoxp) for the RTM API. I've tried, I get an error:
Using an RTM API is hard because of connevectivity issues. |
@MrZeroo00, got the same problem with RTMClient, I'm using a user token (xoxp) under 'channels:read' scope only. Is this issue closed so there will be no update if we wait here? |
@khanhtc1202 To set up a new app, follow the instruction at https://slack.dev/node-slack-sdk/rtm-api
|
Hello awesome folks from slack!! With RTM deprecated what is the alternative for the below usecase?
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. |
@confiq I used "update your apps scopes", so my slack app is not working before was good. |
@whitehat0917 I'm not working for slack but from my understanding, the only good solution is to create a new classic app as mentioned before on this thread. However, slack encourage you to use event API instead of RTM for now. So if you can do it, follow it |
Seems that RTM and all other APIs are going to be dropped entirely in favour of the conversations API: https://api.slack.com/docs/conversations-api which is a major step backwards if true. |
It seems like they re-released this as "Socket Mode" https://medium.com/slack-developer-blog/socket-to-me-3d122f96d955 |
What a shitshow. |
To clarify a few things and (hopefully) address a few of the pain points expressed in this issue:
Apologies if this seems insufficient—the team building Socket Mode is very much trying to address nearly all of RTM's use cases before thinking of deprecation so that apps can build with newer (most of the core features released after 2016) and to-be-released features that expand what they can do without pulling out the rug from under anyone. (And in case anyone is looking for it: the migration guide to the granular token model) |
Description
Cannot star rtm client by providing valid xoxb token shown
not_allowed_token_type
erroruse sample code
Am I missing something ?
I'm sure I am using a bot user token (xoxb), not a user token and the token can push message as bot to specific channel
What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Packages:
Select all that apply:
@slack/web-api
@slack/events-api
@slack/interactive-messages
@slack/rtm-api
@slack/webhooks
Reproducible in:
package version: 5.0.3
node version: 10.15.3
OS version(s): MAC Mojave
Steps to reproduce:
xoxb
tokennot_allowed_token_type
there is no documentation aboutnot_allowed_token_type
errorExpected result:
rtm client should connected
Actual result:
[INFO] RTMClient:1 unable to RTM start: An API error occurred: not_allowed_token_type
Attachments:
The text was updated successfully, but these errors were encountered: