alexkvak/teamcity-slack

BotUsers from new Slack apps not supported (API v2 auth)

queen-of-code opened this issue · 26 comments

Hi, I spent about an hour chasing down this issue - it looks like Slack is moving all new Apps created onto their new Bot beta (with detailed scopes) and there's a limitation that means the instructions in the README will no longer work.
image

If you create a new app (you should be able to test this yourself) and try to use the bot token to authenticate
wget "https://slack.com/api/rtm.start?token=xoxb-mynew-app-token"

you get the response {"ok":false,"error":"not_allowed_token_type"}

Existing/legacy apps are working fine with the existing instructions, but if people opt-into the new beta, they will not be able to use this integration. I don't know when the beta is going to be full production.

@queen-of-code I've just created a new App with bot user and bot oauth scope and everything works fine.

Only one new step I met — when I install app into workspace it asks me about app permission, but default permissions are enough.

do you mean this?

изображение

Oh, I see. Thank you for the report!

It seems that currently used Slack API client https://github.com/Itiviti/simple-slack-api does not support v2 authorization.

On the other hand do you have any information is v2 (Granular scopes) will replace the existing v1 scopes? If not, so we should only update README and use old way.

Yes, Slack does not recommend to use legacy tokens.

https://api.slack.com/docs/token-types#legacy

Could you make a PR into README.md?
I guess your English is better than mine 😃
Please just add notice about legacy tokens into Install plugin section.

New Slack apps don't add bot scope by default. Does this render this integration unusable or is there a workaround?
Screenshot 2020-01-22 at 12 31 17

New Slack apps don't add bot scope by default. Does this render this integration unusable or is there a workaround?

The workaround does not work anymore. When you install the app the new OAuth Scopes will be used. I hope the simple-slack-api will be updated someday.

New Slack apps don't add bot scope by default. Does this render this integration unusable or is there a workaround?

The workaround does not work anymore. When you install the app the new OAuth Scopes will be used. I hope the simple-slack-api will be updated someday.

me to.

New Slack apps don't add bot scope by default. Does this render this integration unusable or is there a workaround?

The workaround does not work anymore. When you install the app the new OAuth Scopes will be used. I hope the simple-slack-api will be updated someday.

me to.

me also

Im unable to use this plugin too since Slack isnt showing the opt in option anymore and it looks like new apps are created with the new scopes.

I just tried this link https://api.slack.com/apps?new_classic_app=1 and it works!

Please take a look at actual just updated README https://github.com/alexkvak/teamcity-slack/#install-plugin

Let's try to live with an old API for a while!

I just tried this link https://api.slack.com/apps?new_classic_app=1 and it works!

Please take a look at actual just updated README https://github.com/alexkvak/teamcity-slack/#install-plugin

Let's try to live with an old API for a while!

Awesome, I can configure it now. Thanks for the quick response and the update to the docs. Its much appreciated.

Thanks Alex,

There is a message on the slack AP page saying:

Beginning February 21, all new app submissions to the App Directory must use granular permissions. Read our blog post.

So I expect this is very much an interim solution. I best go configure my app right now!.

I guess you have no plan to make your bot a public application and publish it to App Directory 🙂

Anyway this solution is temporary and I’m working on simple-slack-api modernization.

Thanks Alex. Love your work.

Unfortunately my PR is still open
Itiviti/simple-slack-api#274

I tried to get this plugin to work, and was unsuccessful. The documentation is worthless with teamcity version 2020.1

I tried to get this plugin to work, and was unsuccessful. The documentation is worthless with teamcity version 2020.1

Thats not a very helpful comment, @alexkvak has done a great job of supporting users. You may prefer to investigate further yourself or request his assistance instead of saying the docs are "worthless" in that version

Created a slack app with following bot scopes, but the token is not accepted by the plugin. I get following error on the plugin admin page, when trying to enable the plugin: "Unable to create session by config: not_allowed_token_type". Any tips? I am running TeamCity version 2020.2.1.
bot_scopes

@JuhaMF could you read https://github.com/alexkvak/teamcity-slack#install-plugin- and #85 (comment) carefully?

You should create legacy app not bot user.

Yes you need use that specific URL (link in the instructions) to create the now-deprecated "classic" app that has the right kind of bot scope that this plugin needs. It is there but well hidden, even in TeamCity version 2020.2.1 Thank you for your assistance @alexkvak !

Fixed in 2.0.0