Closed MattB543 closed 1 year ago
Hi @MattB543, thanks for asking the question. You can use CallbackOptions.success
for it. Refer to https://github.com/slackapi/bolt-js/issues/1571#issuecomment-1231795209 for more details. In your case, you can redirect an installing user to a different domain instead of rendering the webpage.
Hi, @seratch thanks for the reply.
Actually, we want our user to automatically log in to our application with slack OpenID authorization https://slack.com/openid/connect/authorize
.
So in order to do that we need a code
that OpenID authorization returns to the redirect URI, so how we can get it from the app installation?
@themashcodee An app installation into a Slack workspace is indeed an OAuth flow, but it's not compatible with OpenID Connect including the "Sign in with Slack" one. So, if you need an OpenID Connect response, the user needs to go through the Sign in with Slack flow separately. Also, unfortunately, bolt-js does not support Sign in with Slack. You need to add custom routes (or build a different app) for the Sign in with Slack flow. Refer to an example app directly using the underlying @slack/oauth
package: https://github.com/slackapi/node-slack-sdk/tree/main/examples/openid-connect
Lastly, if the reason you're considering "Sign in with Slack" is to receive the installing user's identity, the app installation flow's oauth.access.v2 API response already provides it. If that's the case, you may not have to add the OpenID Connect flow to the app.
I hope this helps.
@seratch thank you so much for the help, I really appreciate it.
Thanks, @seratch , appreciate your quick response!
Description
After a user installs my Slack app I want to redirect them to my web app which is hosted on a different domain, is that possible?
Currently, if I pass my Slack app installation domain as the redirect_uri everything works perfectly.
If I try to update the redirect_uri to be my front-end domain it properly redirects and displays no errors, yet it's not installing the app on the workspace anymore...
Is there something I'm missing in the bolt config?
What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version: @slack/bolt": "3.11.1
node version: v18.12.1
OS version(s):
Steps to reproduce:
Expected result:
The Slack app installs on the workspace and redirects to the domain I set as the redirectUri which is my web app front-end. The front end passes the state and code to the backend and signs the user directly into my web app.
Actual result:
The Slack app does not install on the workspace.
Attachments: