Search code examples
slackslack-api

Test sign in with slack button on an internal network


I have a slack app with a sign in with slack button. Earlier I was testing it on localhost with the redirect url as localhost. Is there anyway I can test the same on an internal network, because right now every time I try to do that as soon as I authorise it redirects me to the localhost.(which it should since redirect url is localhost).

I tried to use the url of my internal network as the redirect url but it does not accept it.


Solution

  • You can only redirect to an URL that is accessible from the public Internet. So you can't redirect to localhost or to a machine that is behind a company firewall and not reachable from the Internet.

    To test your "Sign-in with Slack" button one good approach is to use a tool like ngrok that gives your a public URL and redirects traffic automatically to your local machine via VPN.

    Also check this tutorial from Slack on how use ngrok.