Google doesn’t need to connect to that URL. Google will only redirect to that URL. As long as the URL is valid and you can connect to it locally, it will work. It works for me locally as well. There’s no need to forward or expose any network.
If you mean to make this change in the URI in the Google cloud I have already tried it but I got a 400 error. And I am not sure how to change the redirecting URl on n8n it doesn’t give the option to edit on the setup stage. Do you know if it is possible?
Error 400: redirect_uri_mismatch
So this is different from the Google OAuth URI (which has the :PORT). Now I have tried to change this in the .yml
n8n:
image: docker.n8n.io/n8nio/n8n
container_name: n8n
restart: always
ports:
- 5678:5678
environment:
- N8N_HOST=localhost
- N8N_PORT=5678 - WEBHOOK_URL=http://localhost:5678
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:
But I am noot sure if I am doing the write thing or where else can I change it so that the
Redirect URL changess from: http://localhost to http://localhost:5678 on n8n’s credentials flow.
Thanks so much! not sure what was wrong in the first installation but now I that I have reinstalled it, the redirect is updated with the port. Thanks a lot.
Hello ! I’ve got the same kind of issue here but I’m using n8n on my NAS so I connect to it using 192.168.1.22:5678.
I used webhook_URL to change it in my configuration but Google doesn’t accept http://192.168.1.22:5678/rest/oauth2-credential/callback as a redict URL.
You’d likely have to setup a proxy server like the one described above to forward the connection to that IP. Or, you can complete Google OAuth on localhost and then continue using n8n on your NAS.
So basically, I should run a self hosted version of n8n outside my NAS container directly on my PC and then export the .n8n back to the NAS docker to have credentials set up ?
Yes, either that, or forward your NAS IP to a domain like pointed above. Sadly, it’s a Google limitation of not allowing IPs as callback URLs, so there’s nothing n8n can do to solve that.