I am using a self-hosted instance of n8n on Railway and I am trying to create a workflow that uses Google Sheets. I followed these instructions (Google OAuth2 single service | n8n Docs) step by step, multiple times, and I was never able to get the connection to work. When I would go back to n8n to set up the connection, I am met with an authorization error. I have attached some images for reference.
I really think that I set up everything correctly in Google Cloud Console, I even tried following many different video tutorials and I would always have the same outcome.
I believe this is because if you have not published the google cloud app, then you need to add a test user to gain access to it. So if you go to the enabled APIs and services tab, then navigate to the OAuth consent screen tab, you should see a section saying add test users. Simply add the email you use to access the google cloud app and this should fix the problem.
I’ve been having what sounds like very similar issues trying to connect my Google Drive/Google Drive Node in what should be simple connections, I mean I’ve literally killed 3 full (vacation) days trying to troubleshoot, and have had Gemini models and Claude models help run every single configuration variation within a pretty tight range in Google Cloud Console, but I’m getting the same errors…very frustrating!
I did add my email as a test user already but I get the same issue. The authorization issue occurs right when I get redirected, I do not even have a chance to add the test user.
I’ve done all of the above numerous times as well, and getting the same error messages as the ones you posted Dragan! Really starting to think that the issue is with the n8n platform, and something not wired correctly
I’m having the same issue. What I see is that the OAuth Redirect URL provided in railway Google nodes for authentication don’t include the https:// at the beginning of the link. If I copy the link in Google Cloud Authorized redirect URIs as is, Google won’t accept it, and if I do, then I get the 400 error message when the node is being triggered as I assume they are mismatching. I don’t know who in railway or n8n is responsible for aligning the provided uri properly formed…
by the way, when I try this in a local instance, I get the OAUth Redirect URL from the Google node with https:// at the beginning and the connection works without issue…
I fixed the issue. Go to the n8n main instance and in the variables, look for the WEBHOOK_URL variable at the bottom, edit it, and change its value to https://${{RAILWAY_PUBLIC_DOMAIN}}. Now you should be able to connect to Gmail, google calendar, Pinecone, etc…