Google OAuth2 Redirection Issue with Google Analytics/Drive

**What type of hardware are you using:
** VPS bought online
**What YunoHost version are you running: 12.0.9.1
What app is this about: N8N
**Version of n8n: Version 1.71.2
System: Debian 12

Describe your issue

Hello Yunohost and N8N community, I have installed n8n on my Yunohost server and I’m trying to connect it to my Google Analytics account via OAuth2 to create an automation. However, I’m encountering a redirection issue after authorizing access to my Google account. (I am also experiencing the same problem with Google Drive) (I also know that I successfully connected on n8n Online without any issues, so it seems to be related to this specific n8n instance.) Here are the steps I’ve taken:

  1. I created an application in the Google Cloud Console with the redirect URL: https://[my site]/n8n/credentials/oauth2-credential/callback.
  2. I configured the Google Analytics node in my n8n workflow with my application’s credentials.
  3. When I run the workflow and click the “Sign in” button, I am redirected to the Google authorization page.
  4. After authorizing access, I am redirected to the main page of my n8n instance instead of returning to the workflow.

I have verified that the redirect URL is correct and that my Google Cloud application is properly configured. I suspect that Yunohost requires a specific configuration for OAuth2 redirection. Have you encountered this issue before? Do you know of any solutions or specific configurations to resolve this problem? Thank you in advance for your help.

Share relevant logs or error messages

n8n installation log: (I also want to mention that I completely reinstalled Yunohost to see if the problem could be resolved that way, but it didn’t work) https://paste.yunohost.org/raw/ejilikudac

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Wamimy,

We only provide support in English, would you be able to update your post. We could use something like OpenAI or Google Translate but that may lead to something being translated incorrectly so it is always best if you can post in English.

Done :slight_smile: It’s translate :slight_smile:

Can you help me pls ?

Hi @Jon

Can you help me pls :confused:

Hey @Wamimy,

Sorry I missed this, based on the description of the issue the redirect url is not set correctly. Once thing I did notice is you have mysite/n8n/credentials but we don’t recommend installing n8n in a subpath like that so I would instead use a subdomain like automation.mysite

Hi @Jon ,

I have now installed n8n on a subdomain n8n.sous-domaine.fr

Unfortunately I see the same error…
When I connect with Google and validate the authorizations, I am redirected to the home page of my n8n

please help me :slight_smile:

Can you share the redirect url n8n shows and the value you have put into your Google App for the redirect?

This is the n8n callback : https://[my-site.fr]/rest/oauth2-credential/callback

And is the same value on my google console.
Same problem
I’m waiting y @Jon thanks for yr help :slight_smile:

@Jon Need help. My problem is persist …

Rémy

@Jon
@n8n
Hi, I’ve already the same issue, can you help me pls !

Rémy

Hi, here a video, you can understand he problem :

@Jon @n8n

I need help for resolve my problem pls !

Rémy

There are no people who help me !
Pls community…
@Jon @n8n

Help me pls !