Slack OAuth redirect_uri did not match any configured URIs (self-hosted on Windows)

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @rhb7gcph Welcome to the community!
I guess the problem might be with your BaseURL and how you have set that up, consider recreating new slack Oauth credentials so that slack call back URL matches the redirect URL. If using docker you can set things up like:
N8N_HOST=``your.domain.com
N8N_EDITOR_BASE_URL=https://your.domain.com/
WEBHOOK_URL=https://your.domain.com/

So after this you can restart your n8n and then copy the new Oauth callback url for slack and paste it in the oauth and permissions > redirect url , this will make it work as this is the error which occurs all the time when settling redirect url.

Hey, could you share the full error message you’re getting and how you configured the OAuth redirect URI in your Slack app settings? Also knowing your n8n version and whether you’re accessing it via localhost or some other URL would help narrow this down.

Thanks for your reply.

Here is the full error message I get during Slack OAuth authentication:

redirect_uri did not match any configured URIs
Passed URI:

http://localhost:5678/rest/oauth2-credential/callback

My Slack OAuth redirect URL configuration is:

http://localhost:5678/rest/oauth2-credential/callback

n8n version:
2.9.4

Environment:
Self-hosted on Windows
Running locally at:

http://localhost:5678

I also tried using ngrok, but the redirect URI still appears as localhost.

Let me know if you need screenshots of the Slack OAuth settings or the error screen.
Thank you.

Thanks for the suggestion!

I am not using Docker, I’m running n8n locally on Windows using the standard npm installation.

Do you know the correct way to set N8N_HOST, N8N_EDITOR_BASE_URL and WEBHOOK_URL in this setup?

Currently n8n still generates the OAuth redirect URL as:

http://localhost:5678/rest/oauth2-credential/callback

Even when using ngrok.

Any advice for the Windows / npm setup would be really helpful.

1 Like

Hi @rhb7gcph Understood, what i use are these:
set N8N_HOST=your-ngrok-subdomain.ngrok-free.app
set N8N_PROTOCOL=https
set WEBHOOK_URL=https://your-ngrok-subdomain.ngrok-free.app
set N8N_EDITOR_BASE_URL=https://your-ngrok-subdomain.ngrok-free.app
n8n start

Remember to use these in command line and not in powershell, also ofc you need to run these before starting n8n in the same shell session.

The key thing happening here is that Slack does not accept localhost as a valid OAuth redirect URI for production apps by default.

Even though you’ve configured http://localhost:5678/rest/oauth2-credential/callback in both n8n and your Slack app’s redirect URLs, Slack’s OAuth verification is strict about localhost — it’s allowed only for certain app distribution types.

The actual fix for local Windows development

You need to expose your n8n instance with a public HTTPS URL and use that as the OAuth callback, then set it consistently in both your Slack app settings and n8n’s environment.

The easiest approach on Windows:

  1. Install ngrok: winget install ngrok or download from ngrok.com
  2. Start ngrok pointing at your n8n port: ngrok http 5678
  3. Copy the https URL it gives you (e.g. https://abc123.ngrok-free.app)
  4. Set these environment variables before starting n8n:
    set N8N_HOST=abc123.ngrok-free.app
    set N8N_PROTOCOL=https
    set WEBHOOK_URL=https://abc123.ngrok-free.app
    set N8N_EDITOR_BASE_URL=https://abc123.ngrok-free.app
    npx n8n start
    
  5. In your Slack app settings > OAuth & Permissions > Redirect URLs, remove the localhost URL and add https://abc123.ngrok-free.app/rest/oauth2-credential/callback
  6. Go back to n8n, create a new Slack credential, and the OAuth callback URL should now match

Important: After you set up ngrok, delete and recreate your Slack credential in n8n — the old one was generated when n8n thought its base URL was localhost, so the callback URL embedded in the OAuth flow was already wrong before you even hit Slack’s endpoint.

Note that ngrok’s free tier gives you a new URL each restart, so you’d need to update the Slack app redirect URL each time. For a more permanent local dev setup, the paid ngrok static domain ($8/mo) or alternatives like Cloudflare Tunnel (free) work well.

localhost is not accepted as a valid redirect URI by most apps.

Suggest you to use ngrok tunnel to get a free HTTP domain and point that to your locally hosted n8n, and then regenerate the redirect URI to connect back to Slack.