Search code examples
slackslack-api

How can I change subdomain for Rediret URL in Slack OAuth


Is it possible to change subdomain in redirect URL per customer?

I set the redirect URL in OAuth & Permissions field in my slack app page. Its like https://test.com

Actually, I want to set the redirect URL like https://dev.test.com
"dev" changes per customer.

How can I realize it?

I saw this question and try to do it, but Im not sure how to do it.
Using wildcard subdomain for Rediret URL in Slack OAuth

I use slack button, so I can set state parameter as this. but in the same time, I have to send redirect URL which matchs the redirect URL in OAuth & Permissions field in my slack app page.

<a href="https://slack.com/oauth/v2/authorize?scope=incoming-webhook&client_id=xxxx&state=dev&redirect_uri=https://test.com">
    <img alt="Add to Slack" height="40" width="139" src="https://platform.slack-edge.com/img/add_to_slack.png" srcset="https://platform.slack-edge.com/img/add_to_slack.png 1x, https://platform.slack-edge.com/img/[email protected] 2x" />
</a>

Solution

  • No, there is no option for changing sub domains for each user in slack-api as of now.

    You have to use a single redirect url for all the users, you can later redirect from https://dev.test.com to your desired user(customer) specific url like https://dev.test.com