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

Update Slack provider to use v2 API and allow Bot tokens #645

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

jbrooksuk
Copy link
Member

This PR changes a few things with Slack:

  1. Switches to the v2 API.
  2. Adds a asBotUser() method that switches the type of scopes requested. Slack has two kinds of tokens; xoxb (bot) and xoxp (user). When using asBotUser() the user() method will return an empty user, but a bot token will still be available.

@taylorotwell taylorotwell merged commit 50148ed into 5.x Jul 14, 2023
20 checks passed
@taylorotwell taylorotwell deleted the slack-oauth-v2 branch July 14, 2023 14:23
@ataldev
Copy link

ataldev commented Nov 25, 2023

We should be able to use user_scopes and bot scopes in the same redirect.
For example user_scopes=identity.email&scopes=commands
Currently, to achieve this, the asBotUser can not be utilized. And we should use something like:

return Socialite::driver('slack')->scopes(['identity.email'])->with(['scopes' => 'commands'])->redirect()

Which is not ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants