Hubot-slack: error: Response not OK: not_allowed_token_type

Created on 13 Feb 2020  Â·  13Comments  Â·  Source: slackapi/hubot-slack

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 [ ])

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

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

  • [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [x] I've read and agree to the Code of Conduct.
  • [x] 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

question

Most helpful comment

@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

All 13 comments

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. 🙇

I’ll give it a go tomorrow thanks for clarifying the issue!

On Thu, Feb 13, 2020 at 6:22 PM Kazuhiro Sera notifications@github.com
wrote:

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
https://api.slack.com/apps?new_classic_app=1. Please refer to the
document for details:
https://api.slack.com/authentication/migration#classic

It would be appreciated if you could understand this. 🙇

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/slackapi/hubot-slack/issues/584?email_source=notifications&email_token=AAOD5YD2CCTL3YUX4L26CZ3RCXI3BA5CNFSM4KUZFCXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELW7QJY#issuecomment-586020903,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAOD5YGFHRWUUEFE56AG46DRCXI3BANCNFSM4KUZFCXA
.

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.

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

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

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

@phanisowjanyavutukuri
https://github.com/slackapi/hubot-slack/issues/584#issuecomment-586020903 can be of help. In short, create a new "classic" app from this URL.

@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

@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

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 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

Ok, my bad, used wrong 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)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

genxstylez picture genxstylez  Â·  6Comments

ojacques picture ojacques  Â·  9Comments

rajatguptarg picture rajatguptarg  Â·  5Comments

gabriel403 picture gabriel403  Â·  10Comments

sinisterstuf picture sinisterstuf  Â·  5Comments