Erreur 400 invalid_request trying to configure N8N (local) with Google OAuth

Hi all,

I am starting to use N8N, and I am following training video to perform the connexion to google sheet.

I am blocked on authentification phase. I read some threads here, but I don’t found similar case.

Context :

N8N is installed in local, on my NAS.

version : 1.117.2

N8N version

Google Cloud profile activated, all necessary API activated, user created with redirection, application publied

In N8N, concerning the configuration of OAuth connexion, the URL is

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

The error message is

Erreur 400 : invalid_request

Détails de la requête : redirect_uri=http://0.0.0.0:5678/rest/oauth2-credential/callback flowName=GeneralOAuthFlow

So, I think I got the error due to IP adress into N8N, also google rejects this URL, I should put localhost in goole configuration

Then, I tried to create .env file and put an IP and restart services, without success, still IP 0.0.0.0

N8N_HOST=localhost

N8N_PORT=5678

I think this is due to IP 0.0.0.0, can someone confirme please ? and let me know how to fix it ?

Thanks in advance for your help.

Definetly you have tu use Ngrok or sometihng else that will expose your instance to the internet.
In one phrase, you need publicly URL, then you can set the env with new urls.

Hi

Thanks for your feedback.

One query, why it’s work for him in the video ?

localhost (not 0.0.0.0) is allowed for development, if that was your primary question, but to fully work is needed a public URL, otherwise Google points to their internal path if you use localhost.