Newbie - can't connect gmail - google cloud issues

Describe the problem/error/question: I have a n8n account hosted on hostinger. I am attempting to Authorize the domain in Google Cloud Branding section. But I get an error message attempting to copy paste what appears to the the hostinger host name in the google cloud authorized domain section. I’m not even sure if any of this was really necessary, I only got here after a massive web of redirect instructions just trying to connect my gmail with n8n.

What is the error message (if any)? Invalid domain: must be a top private domain

Please share your workflow: I don’t have a workflow. I am literally stuck on the New Email Trigger (Gmail trigger)

(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): no idea where i would find any of this
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Hostinger
  • Operating system: Ubuntu 24.04

Hey! Let’s check that.

  1. Select your project (at the top) and then enable all services you want to use (Gmail, Calendar, etc): Google Cloud console

  2. Here, make sure your n8n callback URL is added like in my screenshot. Replace localhost:5678 with https://yourn8ndomain.com/
    https://console.cloud.google.com/apis/credentials

  3. Here, make sure you publish your app to In production so your tokens don’t expire:
    https://console.cloud.google.com/auth/audience

Perform these steps and let me know if you get any errors or anything’s not clear :slight_smile:

Hi there @BAdamBafiesta adding gmail is a straight forward task, you just need to generate client ID and client secret from google cloud console > clients and paste it in the gmail node as shown below.

Once you done that, copy this URL which is in the node and paste it in the Google cloud console(Mine domain is duckdns)

Once done…Save and then publish and you are good to go.

Hope this helps!!

From Google Cloud create client, do I need to select web application or desktop app? I tried desktop app and got this error after copy pasting the client ID and client secret. Access blocked: n8n’s request is invalid. Error 400: redirect_uri_mismatch
Request details: flowName=GeneralOAuthFlow

Got a slightly different error trying to select web application

Web application
You got the error because you need to publish the app in the google console

and yes just to mention…make sure you add your domain as well in your branding section as shown below, just to avoid further problems

Thanks alpha - you got me one step closer. I published the Google Cloud project with

I tried using the full srv1011906.hstgr.cloud as domain 2 but get an error message in google console.

I still get the error message when I try to sign in with google

Send me the image of the url pasted in this page just like mine

redirect url image

previously I hadn’t completed that. Now when I click sign in with google i get a different error message

Thank you for the help troubleshooting this!

Update - I canceled my hostinger account and created an account directly on n8n. Connecting with gmail was very simple. Got information that google cloud doesn’t allow subdomains provided by hosting services (like hstgr.cloud).

Good to know your situation is solved. Just make sure to mark this post as “solved”. Let me know if you need anything else. Cheers!!