Add bot to Slack workspace with Nextauth #8286
Unanswered
SujayPrabhu96
asked this question in
Help
Replies: 1 comment
-
Any insight on a solution for this? I'm running into this issue right now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How can I seamlessly integrate the process of adding a bot to a Slack workspace, obtaining the access token through Slack's OAuth, and then using that access token to facilitate a user login without requiring them to be redirected to the 'https://slack.com/openid/connect/authorize' endpoint? This integration needs to occur while still utilizing Next-auth's Slack Provider with JWT strategy in my application.
To provide more context, we have two distinct login flows for users on our site, which serves as a user interface for our Slack app:
We've successfully implemented the 'Sign in with Slack' feature using the Slack Provider from NextAuth with the JWT strategy. This particular functionality is working as expected.
The second approach involves users adding their bot to Slack, which is similar to a sign-up process. To achieve this, our Slack bot needs to undergo the OAuth process outlined in https://api.slack.com/authentication/oauth-v2. I have successfully completed this process and obtained the necessary access token to add the bot to Slack. After this step, I intend to avoid redirecting the user to 'https://slack.com/openid/connect/authorize', as the user has already granted consent during the OAuth process. I attempted to redirect the user to '/authorize' with the 'team' parameter, but the initial request still triggers a redirection to '/authorize', prompting the need for consent once again. Is there a method by which I can simply log in the user once the access token is obtained, without the requirement to redirect them to '/authorize'?
Beta Was this translation helpful? Give feedback.
All reactions