
When using the out-of-the-box Gemini Enterprise web application, identity and access management happen behind the scenes. Employees sign in through Google Identity or Workforce Identity Federation (such as Microsoft Entra ID or Okta), search results automatically respect per-user access controls (ACLs), and third-party login prompts for Federated Connectors or custom agents appear automatically in the chat UI.
In practice, however, many enterprises build their own Customer UI to embed Gemini Enterprise into an internal portal, intranet, or line-of-business application. To do this, Customer BE calls the Gemini Enterprise StreamAssist API.
The moment an application builds a custom UI and calls the StreamAssist API directly, the three authentication flows that the built-in web app handled automatically become the responsibility of Customer UI and Customer BE:
This guide walks through the architecture, component flows, and runnable code for all three layers (Figure 1):
Depending on whether Customer UI is acting on behalf of an individual employee or running as a shared backend bot, customer architectures follow three keyless authentication patterns:
Required IAM Role and License: Every principal calling the StreamAssist API must be granted the Discovery Engine User IAM role on the GCP project. For human user patterns (Pattern 1A and Pattern 1B), the user (or Workforce Pool group) must also have an active Gemini Enterprise user license assigned in the Admin Console.
When employees sign in with Google Workspace or Cloud Identity and the Gemini Enterprise engine is configured for Google Identity, the flow has zero extra hops:
When employees sign into Customer UI with Microsoft Entra ID or Okta and Gemini Enterprise uses Workforce Identity Federation (WIF), you reuse the same Workforce Pool that is already connected to Gemini Enterprise:
When a backend service, Slack/Teams webhook, or non-personalized knowledge bot needs to call StreamAssist without any Service Account JSON keys, use a project-scoped Workload Identity Pool:
When to use Pattern 1C vs. Patterns 1A and 1B: Because Workload Identity Federation authenticates a machine rather than an individual human employee, Gemini Enterprise sees every request as coming from the same workload identity. Use Pattern 1C for non-personalized bots over shared knowledge bases, and use Pattern 1A or Pattern 1B whenever you need per-user document ACLs, user-specific 3LO connectors, or restricted custom agents.
Once Customer UI and Customer BE are calling StreamAssist as the signed-in employee, users can query native Federated Connectors (such as Google Drive, Microsoft SharePoint Online, Jira, Box, ServiceNow, and Confluence) that search live third-party APIs in real time.
Because Federated Connectors enforce user-level permissions in the third-party system, each employee authorizes the connector once using 3-Legged OAuth (3LO). Gemini Enterprise stores those per-user refresh tokens inside its own managed Keystore, so Customer BE never has to store third-party credentials in its own database.
Note for Custom UIs: Enabling Automatic Popup Handoff from GE FE Server: All Gemini Enterprise Federated Connectors use Google's managed /oauth-redirect endpoint on GE FE Server as their fixed callback URL. By default, that page only sends browser postMessage events to the built-in Gemini Enterprise web app origin. When deploying Customer UI on a custom domain, work with your Gemini Enterprise team to enable the custom origin flag so Step 7 automatically posts the callback URL to Customer UI and closes the popup.
Native Federated Connectors are ideal for federated search and built-in actions. When a workflow requires multi-step reasoning, custom Python logic, or orchestrating across multiple enterprise APIs in a single assistant, teams build a custom ADK agent, deploy it on Vertex AI Agent Engine, and register it in Gemini Enterprise.
When registering an ADK agent in Gemini Enterprise, attaching static OAuth configurations directly to the root agent registration creates two issues for a custom UI:
To trigger 3-Legged OAuth on demand per tool and let Gemini Enterprise and Google Cloud manage the per-user Token Vault automatically, follow three simple setup steps:
We have packaged all three authentication layers, along with interactive web test UIs, CLI scripts, and curl commands into the gemini-enterprise-custom-ui-auth GitHub repository:
Benchmarking MoE Training on Ironwood, Part 1: Scaling to 8K Chips
From Files to Cited Answers in One API Call: Managed Ingestion and SearchDocuments in Agent Retrieval
Did the user ask for this? Securing AI agents against intent hijacking with Semantic governance policies