Google OAuth issue

noticed a new issue with in n8n Google Nodes and credentials with Google OAuth credential windows, which previously never had.
First, the “save” button in the top right is no longer showing. When I open the window, it flashes for a hot second, and it’s gone.
Second issue, When I send the “Sign in with Google” URL to a client (they are listed as testers, as I am in the Google Cloud Console with owner permission), they get the Google permission screen ([MY ACCOUNT] wants access to your Google account), but once they clint send/accept, there’s a JSON error: {status: error, message: unauthorized}.

What’s going on, and how do I correct this. any help as well as how to build Google credentials on my self-hosted n8n instance for client access (client’s workflow which I build and host) would be appreciated

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(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):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @balih00, while you wait for a response, here are some things that might help:

Suggested resources

Automatically matched to your question.

Docs:

Forum:

@Michael_Frostbutter, @Tarun_Kumar - you’ve helped with similar issues before, can you take a look?

Automatically suggested by n8n’s community bot. It’s a pilot - please share feedback here.

Hello @balih00 you are welcome.

  1. Why the “Save” Button Disappears.

This is intentional. In newer versions of n8n , the manual "Save’ button has been replaced with auto-save. The temporary flash you see is the UI initailizing the automated saving state.

  1. why the {status: error, message: unauthorized} Error happens.
    you cannot send an OAuth conection link to another person. when you click “Sign in with Google”, n8n binds the authorization handshak to your specific , active browser session.

when your client clicks the link on their computer:

…Their browser lacks your active n8n session cookies.
… The state token mismatches , causing n8n to reject the callback as an unauthorized request .

  1. How to correct this for your clients.
    choose one of this two verified method to fix the issue:

Method 1. Use Google Service Account( the most recommended way)
Instead of OAuth2 , create a Google Service Account in the Google Cloud Console .
Download the JSON key file, and put it directly into n8n’s Google Service Account credential type . Share the client’s Google Sheets or Drive folders directly with the Service Account email. This bypasses browser authtentication completely.

method 2: invite the client to your n8n instance (which i hardly recommend)
Go to settings> users in n8n and invite you client . Have them log into your n8n instance from their own browser , open the credential window , and click Sign in with Google themselves. The connection will succeed because the session starts and ends on the same machine .

check the n8n Google OAuth2 Generic Setup Guide Google | Nodes | n8n Docs

and the n8n Google Drive Credentials Guide

Hi @balih00,

The Google tester list is probably not the issue here.

The “Sign in with Google” URL isn’t a shareable client authorization link. n8n ties that OAuth flow to the credential and the authenticated n8n user who started it. If your client opens the copied URL in another browser, Google can complete its consent screen, but n8n rejects the callback with:

{status: error, message: unauthorized}

Have the client log in to your n8n instance, give them access to the relevant project/credential, and let them click “Sign in with Google” from the credential screen themselves.

For client workflows, the practical options are:

  1. Create a separate fixed credential for each client and let that client connect it while logged into n8n.
  2. If you have Enterprise, use an end-user credential so each n8n user connects their own Google account.
  3. Use a service account only for supported Google nodes and resources such as Sheets or Drive files that can be shared with the service-account email.

The disappearing Save button is a separate issue. In current versions it should remain visible, although it may be disabled until the required fields are filled or changed. Could you share your exact n8n version? I would first update to the latest supported release and test after a hard refresh or in a private browser window.

Also make sure the OAuth Redirect URL shown inside the n8n credential is copied exactly into Google Cloud’s Authorized redirect URIs:

End-user credentials are documented here:

I like method 1. I’m also hearing from another source that setting N8N_SKIP_AUTH_ON_OAUTH_CALLBACK=true in the .env (self-hosted) bypasses the sign-in. can you confirm this?

@balih00 Welldone..

No, please don’t use that setting . it will not solve your problem , and it creates a major security risk.
Here is exactly why you should avoid N8N_SKIP_AUTH_ON_OAUTH_CALLBACK=true:

1…It still fails accross different computers : This environment variable only stops n8n from verifying if a user is logged into the n8n dashboard. it does not bypass the browser-level OAuth state (CSRF) token check . Because you generated the link on your computer and your client opened it on theirs, the state token will still mismatch, and the connection will fail..

2…It exposes you to a security vulnerability : Turning this setting to true disables ownership checks on OAuths callbacks [GHSA-vpgc-2f6g-7w7x]. This makes your self-hosted instance vulnerable to authorization bypass exploits where malicious actors can hijack credentials [GHSA-vpgc-2f6g-7w7x].

3… Its acutal purpose : This flag was designed exclusively to fix session-cookie dropping caused by complex reverse proxies (like cloud Run or Traefik)-not to allow sharing authentication links accross different users.

To back the Google service account setup check this n8n docs Google Service Account | Nodes | n8n Docs

@balih00
However,
To Help generate a Google Service Account JSON Key , go to the Google Cloud Console, open your project and navigate to IAM and Admin> Service Accounts.

  1. Click create service account at the top of the page.
  2. Enter a name for the service account and click Create and Continue.
  3. Skip assigning optional roles and click Done.
  4. Click on the email address of the service account you just created from the list.
  5. Go to the keys tab at the top of the profile page.
  6. Click Add Key, select Create new key , and choose JSON.
  7. Click Create to download the JSON key fiile directly to your computer.

After downloading , remember to open your Google Drive or specific Google Sheets and share them directly with the service account’s email address (found inside the downloaded JSON files as client_email) with Editor permissions.

Correct me if i’m wrong, but the Google service account path is only good for files (Google Sheets, docs, GDrive…). I need my workflows to access and send/read my client’s Google Calendar and Gmail, which won’t work with the google services account method.

@balih00
Now to show you how to upload this json key into n8n.

step 1: Open or create the credential in n8n

  1. Open your n8n dashboard and navigate to credentials in the left sidebar.
  2. Click Add credentials (top right).
  3. Search for and select Google Service Account , then click Create.

step 2: Copy the service Account email

  1. Inside your open Json file , locate the line that starts with “client_email”.
  2. Copy the email address inside the quotation marks (e.g your-acccount-name@project-id.iam.gserviceaccount.com).
  3. Paste this value into n8n’s Service Account Email Field.

step 3. copy the private key (crucial formatting)

  1. Inside your json file, locate the long block text starting with “private_Key”.
  2. Copy the entire block value inside the quotation marks , but do not include the double quotes themselves.
  3. Important formatting tip: Ensure your selection includes the full headers: -------BEGIN PRIVATE KEY------\n… all the way through …-------END PRIVATE KEY-------\n. keep the literal \n characters intact.
  4. Paste this block directly into n8n’s Private key field

step 4 Save & Connect

  1. Click save(or let auto-save catch it )
  2. The credential status will show as active. you can now select this credentials type directly inside individual Google sheets , Docs , or Drive nodes by changing their authentication method from “OAuth2” to service Account.

You are correct in practice, but there is a slight technical difference between what Google allows and what n8n natively supports

The Right Path Forward for Calendar and Gmail.
Because Service Accounts are blocked or discouraged for these nodes, your best strategy for managing your client’s workflows is User Management

  1. Under Settings > Users in n8n, send an invite to your client.
  2. Have them log into your n8n dashboard once from their computer.
  3. Guid them to open the native Gmail or Google Calendar node, choose OAuth2 and click Sign in with google using their own acccout.

This safely binds their ongoing refresh token directly into the native n8n node layout without any session conflicts or complex custom API boilerplate!

Thank you. Neither the Service Account method or inviting clients to an n8n instance (which is a live/production instance hosting several other client workflows) is the answer. Using OAuth and publishing the app (from test) did the trick