Adding Gmail Credential | Problems with OAUTH - Selfhosted

Hey Guys,
Im recently trying to add Google Credentials to my self hosted n8n. The Problem is i can’t paste the “OAuth Redirect URL” to " Authorized redirect URIs" in my created Google Client. So i created a tunnel with ngrok, but I still get an error message:

Information on your n8n setup

  • n8n version: 1.83.2
  • Running n8n via Docker
  • Operating system: Windows 10

For the redirect URL, it has to be either:

  1. https AND a valid, registered top level domain
    OR
  2. localhost or equivalent

If you have all that set, and the redirect url you put in the google developer console matches the one n8n shows you in the credentials…

If you haven’t verified and published the google app, you also need to add the email address of each user that will be allowed to authenticate as a test user here

I pasted the ngrok link in that field below:


but I still get that error message. I already added the mail address as a test user.

Did you setup the google concent screen properly. Also when you are providing redirect URIs just put the domain and do not use the route paths.

I think I set it up right…

~ thanks, but i didn`t change anything :confused:

First test the redirect url in a browser.

  • Copy from the credential dialog Oauth2 Redirect URL field.
  • Paste in the address bar of a new browser window/tab
  • That part is probably ok if you see a message from n8n like: Error: Insufficient parameters for OAuth2 callback.
    • Also, you are correct, and you should not change anything when you add the redirect URL to your App/Client’s Authorized redirect URIs in the Google developer console. It does need to include the full rest/oauth2-credential/callback part too.

Next you might research whether access to *.ngrok-free.app might be getting blocked by malware software, a firewall, or some other way. I did a quick search, but didn’t find anything definitive. If you suspect this might be the issue, maybe try to prove/disprove it by trying a different tunnel provider.

I gave up on the self-hosted version. It was to much headache to get the credentials right because of the redirect URL. So investing in ngrok pro version isn’t worth the money, when you can just host your n8n on a vps. Now I host my n8n on a hetzner vps and everything is working fine so far. Big Thank you for helping me out :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.