I am encountering an “Invalid Redirect” error when configuring Google OAuth for n8n. The error message states, “must end with a public top-level domain (such as .com or .org).” I believe this is caused by the redirect URL n8n is generating, which differs from Google’s requirements. My n8n instance is running in a Docker container on a TrueNAS machine. How can I resolve this domain validation issue?
Hey @woriqowi The error occurs because the redirect URI is not a public FQDN (Fully Qualified Domain Name) but rather a local address (e.g., localhost) that includes a port, like :30109. Google requires a valid TLD such as .com or .org.
To resolve this for a local setup, you need to use a secure tunneling service that provides a public HTTPS endpoint, such as ngrok or Cloudflare Tunnel. Alternatively, you can utilize the native n8n tunnel by running the application with the tunnel command line flag.
Ah, I see the error in my configuration. The presence of the NGINX reverse proxy providing a public domain is insufficient; I need to ensure that domain is correctly mapped and declared within the n8n application itself via its environment variables to resolve the redirect URL issue.
Yes @woriqowi For the fastest solution, use ngrok. After installing and logging in via the instructions on ngrok.com like ngrok — Log in ), run the following command in your terminal:
ngrok http 30123
This generates a public HTTPS URL. Take that URL, append the necessary callback path specifically /reset/oauth2-credentials/callback and use the resulting full address as the redirect URL in your Google Cloud configuration.