Google API OAuth2 Authorization Issue with n8n Self-Hosted on Hostinger (Gmail & Docs)

Hi everyone,

I’m having trouble setting up Google OAuth2 credentials in my self-hosted n8n instance, which I run on a custom subdomain provided by Hostinger: https://n8n.srv820242.hstgr.cloud. I want to use the Gmail and Google Docs nodes, so I created a project in the Google Cloud Console, enabled the relevant APIs, and set up OAuth2 credentials of type “Web application”.

I used the following redirect URI:
https://n8n.srv820242.hstgr.cloud/rest/oauth2-credential/callback
This URI is added both in my Google Cloud credentials and in the n8n credential settings.

However, when I try to connect the account in n8n, the Google login either fails with a message about an unauthorized redirect URI, or leads to a blank screen or 403 error.

My n8n setup is self-hosted on shared hosting (Hostinger), running with default settings (SQLite database, own process mode, no Docker). Everything else seems to work fine on my instance, and SSL is active.

I’m wondering if this could be due to how Hostinger handles callbacks or if something is wrong in my OAuth2 configuration. Has anyone experienced a similar issue or successfully connected Google APIs in a similar hosting environment?

Thanks a lot for your help,
Léo
![Capture d’écran 2025-05-12 à 17.49.27|690x284]


(upload://dLblEOTx8twFL6gzHkBDbRr0Oa3.png)

“I have the same problem. Is it possible that the API takes time to deploy? I thought I read that Google indicated from 5 minutes to 2 days.”

1 Like

This is what I was thinking too but 2 days seems very long. I retried today but I still have the same problem

Hello, Karim after searching a bit an other posts I found a solution for this exact issue on a post. I hope it will help you

The post was saying: Hi I also came across this problem earlier before.

I found out one of the issues for that is the google cloud project is on test mode and you might have to approve your email to make it work by adding it in under the test user section.

I managed to make it work after adding that in so hope this helps those who face this same issue as well!

2 Likes

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