Skip to content

Bug: Gemini CLI Enterprise (Workspace) OAuth bypasses Admin API controls & fails project linking, causing /privacy error [#2407] #12121

Description

@jclicky

What happened?

Our Google Workspace Enterprise Plus organization has our Google Admin console "API controls" set to "Don't allow users to access any third-party apps” (https://support.google.com/a/answer/7281227) & “Allow users to request access to unconfigured third-party apps” at this Admin Console Endpoint (https://admin.google.com/ac/owl/settings) to enforce a default-deny security posture.

Despite this, our enterprise users (with Workspace Enterprise Plus licenses) are able to successfully authenticate to the Gemini CLI using "Option 1: Login with Google (OAuth)". Users reach this endpoint when they ought to be redirected to a GCP-project-specific endpoint to confirm if they have access to a specific GCP account with the right permissions to bill calls to the appropriate Gemini APIs (if activated on that GCP Project) & bill to that GCP project. No check or handshake occurs & end-users (after ONLY selecting their Google Workspace account via OAuth) reach this screen:

Image

See: https://google-gemini.github.io/gemini-cli/docs/get-started/authentication.html & https://github.com/google-gemini/gemini-cli

The authentication is being granted to a global, Google-owned OAuth Client ID: 681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com. This Client ID has not been configured or trusted in our Google Admin console's "App access control" list.

This appears to be a critical administrative governance failure, as this Google-owned application is bypassing the explicit API controls set by our administrators here at this endpoint: https://admin.google.com/ac/owl/list?tab=configuredApps.

This flawed authentication flow has two significant side-effects:

  1. No GCP Project Selection: The authentication flow never prompts our enterprise users to select a Google Cloud Platform (GCP) Project. This is in direct conflict with the enterprise setup documentation for Gemini Code Assist and the CLI's own documentation, which states enterprise users must "remember to set the Google Cloud Project".

    Image
  2. Broken Privacy State: Once authenticated (again, ONLY to a Google Workspace Enterprise Plus account), running the /privacy command in the CLI fails [similar to /privacy: Error loading Opt-in settings: User does not have a current tier #2407] with the error: Error loading Opt-in settings: User does not have a current tier. Pres Esc to exit. This suggests the backend (er, frontend?) recognizes the user has authenticated with enterprise account (which has no consumer "tier") vs. a Google One account, but is stuck in a broken state because the authentication path / OAuth was incorrect and/or incomplete.
    Image

What did you expect to happen?

We expected one of two outcomes:

Expected Outcome A (Policy Enforced):
The OAuth attempt should be blocked by our Google Workspace policy. The user should receive an admin_policy_enforced error because the Client ID 681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com is an "unconfigured third-party app" and should be blocked per our Admin console settings.

For example, the CLASP CLI (https://github.com/google/clasp), a Google Application, also specifically required our Google Workspace Administrators to whitelist it's corresponding Client ID 1072944905499-vm2v2i5dvn0a0d2o4ca36i1vge8cvbn0.apps.googleusercontent.com for the CLASP tool to be available to end-users, as does the multitude of Google Event pages / interfaces / applications for Cloud Next + I/O, etc.

Expected Outcome B (Correct Enterprise Auth Flow):
Alternatively, if Google-owned apps are intended to bypass this third-party app block (unlikely, again, given the CLASP CLI & other Google Apps Governance):

  1. The authentication system should still detect if the user has a "paid Code Assist License from [their] organization" - it should have a methodology via redirect to see if the User has such a license & the authorities to commit expenses to it vs. the current OAuth flow.
  2. The OAuth flow should then force the user down the enterprise authentication path (documented as the "Vertex AI" path), unless the OAuth is intentionally & expressly permitted to Google Workspace Enterprise end-users at the OAuth-tier (unlikely given that Gemini CLI is absent from Gemini AI Ultra tier documentation for business), in which case the API governance should still enable admins to either permit or block the Gemini Code Assist and Gemini CLI app
  3. If Google envisions for all Workspace Enterprise end-users to only ever authenticate via GCP, then the enterprise OAuth path should mandate that the user "set the Google Cloud Project" and verify they have the correct IAM roles and that the geminicloudassist API is enabled on that project before authentication succeeds. This is the end-user OAuth behavior we see in the Gemini Code Assist IDE plugin (an OAuth event to Workspace Enterprise account still forces the user to set a specific GCP project, after which the plugin confirms that end-user has the appropriate permissions for said GCP Project and that it has the requisite APIs activated), but the Gemini CLI is failing to follow that same flow. https://docs.cloud.google.com/gemini/docs/discover/set-up-gemini

Client information

Client Information

Run gemini to enter the interactive CLI, then run the /about command.

> /about

╭────────────────────────────────────────────╮
│                                            │
│ About Gemini CLI                           │
│                                            │
│ CLI Version    0.10.0                      │
│ Git Commit     5d92b507                    │
│ Model          gemini-2.5-pro              │
│ Sandbox        no sandbox                  │
│ OS             darwin                      │
│ Auth Method    OAuth                       │
│                                            │
╰────────────────────────────────────────────╯

Login information

We are using Option 1: Login with Google (OAuth login using your Google Account), as described in the authentication guide.
A.) Enter command /auth
B.) Open OAuth session via browser (initiated from within Gemini CLI on Google account in browser, select correct specific account
C.) Redirected to this endpoint: https://developers.google.com/gemini-code-assist/auth/auth_success_gemini
Image

We are not using Option 2 (Gemini API Key) or Option 3 (Vertex AI / gcloud auth).

The core issue is that our Enterprise users are being incorrectly funneled down this "Option 1" consumer-style path, which is where the governance failures (bypassed API controls, no project linking) are happening, then when they try using /privacy they receive an error, leading to open-questions about our data governance.

Anything else we need to know?

This appears to be a critical gap in administrative governance with serious data privacy implications. Our primary concern is that if our enterprise users - who are contractually guaranteed "no training, no human review" data protections - are being authenticated through a consumer-facing, global Client ID, we have no way to audit or verify that these enterprise protections are being technically applied. The /privacy error is our only indication that the system recognizes the user's non-consumer status.

This issue is compounded by conflicting documentation:

This creates an incoherent experience where our users are (correctly) told they are ineligible (if they proactively check via an esoteric link buried in GitLab quota documentation at all), but the CLI still authenticates them (incorrectly) by bypassing our admin controls, landing them in a broken, semi-authenticated state where effective data-privacy / governance controls for the session are unclear and inconsistent with available public documentation.

Google Workspace Enterprise Plus End-users reasonably expect for data-governance to apply to any authenticated Google service using their Workspace account, preventing data retention and/or the use of data to train models, but this may or may not be in-effect for end-users in this incomplete (current) OAuth flow, leading to a sub-standard developer experience and inability to enforce disciplined data-governance at an organizational level.

The only functional (but complex) workaround is to manually force the enterprise path (Option 3: Vertex AI) by running gcloud auth application-default login and setting the GOOGLE_CLOUD_PROJECT environment variable. The default "Login with Google" (Option 1) should not be available as a bypass for enterprise accounts whose admins have blocked third-party apps.

Corresponding Google Issue Tracker (Buganizer) Issue (Number 455605678): https://issuetracker.google.com/issues/455605678

Implicated Code:

  1. * SPDX-License-Identifier: Apache-2.0
  2. - **`/privacy`**
  3. - **`/privacy`**

Related Issues:

Metadata

Metadata

Assignees

Labels

Type

Projects

Status
Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions