Google Workspace Admin oauth credentials - Error 400: admin_policy_enforced

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:

create a service account with domain-wide delegation :
Google Workspace blocks admin OAuth for security reasons, so the service account approach is usually the most reliable solution.

Ok thanks, I’ll look up service accounts and give this a try.

Here is the steps to perform that:

  • Go to Google Cloud Console → IAM & Admin → Service Accounts
  • Create a new service account
  • Enable domain-wide delegation
  • Download the JSON key file
  • In your Google Workspace Admin Console, authorize this service account with the necessary API scopes
    If my answer helps resolve your issue, please consider marking it as the solution! A like would make my day if you found it useful! :closed_lock_with_key::sparkles:
1 Like

I was able to add the service account. Just gotta start testing now to make sure it works. Thank you!

After adding the service account and it showed it was connected. I create the node for Google Workspace Admin and the service account I created is not available under the Google Workspace Admin node where you select the credentials. I’m forced to add credentials and OAuth2 is the only option I have. Any other ideas?

Alternative: Use a dedicated non-admin account:

  • Create a regular Google Workspace user
  • Grant only the specific permissions needed
  • Use this account’s credentials instead

Let’s say I create a dedicated non-admin account, when I use the Google Workspace Node, I’m forced to user a Client ID and Client Secret. Where would I input this dedicated non-admin account credentials to?