Skip to content
New issue

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

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

Already on GitHub? # to your account

error: Response not OK: not_allowed_token_type #584

Closed
5 of 9 tasks
EasyAsABC123 opened this issue Feb 13, 2020 · 13 comments
Closed
5 of 9 tasks

error: Response not OK: not_allowed_token_type #584

EasyAsABC123 opened this issue Feb 13, 2020 · 13 comments
Labels
question M-T: User needs support to use the project

Comments

@EasyAsABC123
Copy link

EasyAsABC123 commented Feb 13, 2020

Description

Running HUBOT_SLACK_TOKEN=xoxb-[omitted] ./bin/hubot --adapter slack
results in

rror: Response not OK:  not_allowed_token_type
info: Unable to rtm.start, attempting reconnect
warn: Reconnecting, on attempt 1
error: Response not OK:  not_allowed_token_type
info: Unable to rtm.start, attempting reconnect
warn: Reconnecting, on attempt 2

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

error: Response not OK: not_allowed_token_type

Reproducible in:

hubot-slack version: 4.7.1

node version: v12.4.0

OS version(s): MacOS 10.15.3

Steps to reproduce:

  1. yo hubot
  2. add slack adapter
  3. run with slack adapter putting in a token that doesn't have classic bot scope (deprecated)

Expected result:

It to connect to the workspace

Actual result:

fails to connect unsupported token, this works on my other app that has the classic token.

Attachments:

Screen Shot 2020-02-13 at 2 14 17 PM

@seratch seratch added the question M-T: User needs support to use the project label Feb 13, 2020
@seratch
Copy link
Member

seratch commented Feb 13, 2020

putting in a token that doesn't have classic bot scope (deprecated)

As you may be aware, RTM is no longer available for granular-permissions-enabled (= the default) apps. That's the reason you encountered this issue.

It's still possible to create a new classic app from this URL. Please refer to the document for details: https://api.slack.com/authentication/migration#classic

It would be appreciated if you could understand this. 🙇

@EasyAsABC123
Copy link
Author

EasyAsABC123 commented Feb 13, 2020 via email

@relistan
Copy link

This does work, using the link above. When assigning permissions you need to assign the Scope "bot" and it will warn you about it being deprecated. You also need to create a bot user from the "App Home" page on Slack before you can install to the workspace.

@tg90nor
Copy link

tg90nor commented Mar 5, 2020

The docs should be updated to mention you need a classic app for this adapter to work.

@seratch
Copy link
Member

seratch commented Mar 5, 2020

@tg90nor Thanks for your feedback! I will feed your feedback to the team concerned. 🙇

@phanisowjanyavutukuri
Copy link

Hi,
Even I am getting the same error, Actually I wanted to migrate the hubot from legacy tokens to oauth tokens
Can anyone help in this

@seratch
Copy link
Member

seratch commented Apr 9, 2020

@phanisowjanyavutukuri
#584 (comment) can be of help. In short, create a new "classic" app from this URL.

@phanisowjanyavutukuri
Copy link

@seratch I have created the classic app and installed the app in the workspace with the oauth scope permissions but unable getting the Response not OK: not_allowed_token_type error
Did I miss anything

@seratch
Copy link
Member

seratch commented Apr 9, 2020

@phanisowjanyavutukuri There are two ways to configure Hubot app for Slack. Both should work fine for you.

Setup Hubot integration

Setup a Classic App

  • Create a classic app from https://api.slack.com/apps?new_classic_app=1
  • Go to Features > OAuth & Permissions > Scopes
    • Click "Add an OAuth Scope"
    • Search "bot" and choose it
  • Go to Features > App Home
    • Click "Add Legacy Bot User"
    • Input "Display Name" and "Default username"
    • Click "Add"
  • Go to Settings > Install App
    • Click "Install App to Workspace"
    • Complete the OAuth flow

@seratch
Copy link
Member

seratch commented Apr 14, 2020

As my previous comment answered this question, let me close this issue now. Please feel free to reopen if you have something to ask/clarify here.

@seratch seratch closed this as completed Apr 14, 2020
@lukaszlenart
Copy link

@seratch I tried follow your advice but

Search "bot" and choose it

there is not such scope as bot :\

Screenshot 2020-04-29 at 16 06 02

@lukaszlenart
Copy link

Ok, my bad, used wrong link :)

@sam-6174
Copy link

Ok, my bad, used wrong link :)

for anyone else who stumbles into this edge case, you need to use the following link when creating your app

https://api.slack.com/apps?new_classic_app=1

(if you close the "create classic app" popup and then later click the button "create app," you will no longer be creating a classic app)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
question M-T: User needs support to use the project
Projects
None yet
Development

No branches or pull requests

7 participants