在使用开箱即用的 Gemini Enterprise Web 应用程序时,身份和访问管理在后台自动完成。员工通过 Google Identity 或 Workforce Identity Federation(例如 Microsoft Entra ID 或 Okta)登录,搜索结果会自动尊重每个用户的访问控制列表(ACL),并且针对 Federated Connectors 或自定义代理的第三方登录提示会出现在聊天用户界面中。
然而,在实践中,许多企业构建自己的客户用户界面(Customer UI),将 Gemini Enterprise 嵌入到内部门户、内网或业务线应用程序中。为此,客户后端(Customer BE)调用 Gemini Enterprise StreamAssist API。
当应用程序构建自定义用户界面并直接调用 StreamAssist API 时,内置 Web 应用程序自动处理的三个身份验证流程的责任就转移到了客户用户界面和客户后端上:
向 StreamAssist 进行身份验证(用户身份与工作负载身份):对于涉及文档 ACL、隔离的聊天历史记录和受限代理权限的用户面向型应用程序,客户用户界面和客户后端必须通过 Google Identity(模式 1A)或 Workforce Identity Federation(模式 1B)传递已登录员工的身份。对于非个性化的后端机器人或共享服务门户,客户后端可以使用工作负载身份联合进行无密钥身份验证(模式 1C)。
通过客户用户界面验证 Federated Connectors:实时的 Federated Connectors 使用三方 OAuth(3LO),因此它们仅检索已登录员工有权查看的 Google Drive 文件、SharePoint 站点、Jira 问题或 ServiceNow 事件。由于客户用户界面没有 Gemini Enterprise 内置的连接按钮,客户后端和客户用户界面必须发现引擎的连接点,检查密钥库中是否存在有效令牌,在需要时触发 3LO 同意弹窗,将刷新令牌保存在密钥库中,并将连接器数据存储包含在 StreamAssist 查询中。
处理自定义 ADK 代理的每工具 OAuth:当在与多个企业系统(如 Google Drive 和 Microsoft SharePoint)连接的 Vertex AI Agent Engine 上部署自定义 ADK 代理时,在根代理注册级别附加静态 OAuth 配置会阻止整个代理的前端运行。相反,通过使用 GcpAuthProvider(由 GCP Auth Manager 的 Token Vault 提供支持)包装受保护的子代理工具,并开启代理身份进行部署,StreamAssist 仅在调用受保护工具时触发按需的 3LO 弹窗。
本指南将逐步介绍所有三个层的架构、组件流程和可运行代码(图 1):
图 1:跨 StreamAssist 登录(Google Identity、Workforce STS 或 Workload STS)、Federated Connectors(密钥库)和自定义 ADK 代理(Vertex AI Agent Engine + GCP Auth Manager Token Vault)的端到端身份验证架构。
第一部分:向 StreamAssist 进行身份验证的三种模式(用户与工作负载)
根据客户用户界面是代表个别员工运行还是作为共享后端机器人运行,客户架构遵循三种无密钥身份验证模式:
图 2:比较调用 StreamAssist 的模式 1A(纯 Google Identity)、模式 1B(Workforce Identity Federation + Google STS)和模式 1C(Workload Identity Federation + Google STS)。
所需的 IAM 角色和许可证:每个调用 StreamAssist API 的主体都必须被授予 GCP 项目上的 Discovery Engine User IAM 角色。对于人类用户模式(模式 1A 和模式 1B),用户(或 Workforce Pool 组)还必须在管理控制台中分配有效的 Gemini Enterprise 用户许可证。
模式 1A:纯 Google Identity(Google 登录 UI 到 StreamAssist)
当员工使用 Google Workspace 或 Cloud Identity 登录,并且 Gemini Enterprise 引擎配置为 Google Identity 时,该流程没有额外的跳转步骤:
客户用户界面使用 Google Cloud Platform 范围通过 Google Identity Services(OAuth 2.0)为员工登录。
Google 返回一个限定于已登录员工的用户访问令牌。
客户后端服务(Customer BE)将该 Bearer 令牌直接发送给 StreamAssist API。
模式 1B:劳动力身份联合(外部 IdP UI 到 Google STS 到 StreamAssist)
当员工使用 Microsoft Entra ID 或 Okta 登录客户 UI,且 Gemini Enterprise 使用劳动力身份联合(WIF)时,您可以重复使用已连接到 Gemini Enterprise 的同一劳动力池:
在现有的 WIF 提供商上注册客户 UI:将自定义 Web 应用的 Entra ID 或 Okta 客户端 ID 添加到 Google Cloud 劳动力池 OIDC 提供商。
在 Google STS 交换 IdP 令牌:员工登录客户 UI 并从 Entra ID 或 Okta 收到 OIDC 令牌后,客户后端服务会在 Google Security Token Service (STS) 针对劳动力池提供商交换该令牌。
使用联合用户令牌调用 StreamAssist:Google STS 返回一个代表该特定劳动力池用户的短期 Google 访问令牌,强制执行该员工的所有组权限和文档 ACL。
模式 1C:工作负载身份联合(后端/共享机器人到 Google STS 到 StreamAssist)
当后端服务、Slack/Teams Webhook 或非个性化知识机器人需要在不使用任何服务账户 JSON 密钥的情况下调用 StreamAssist 时,请使用项目范围的工作负载身份池:
从外部 IdP 获取机器 JWT:客户后端服务向外部 IdP(例如,在 Entra ID 中使用 OAuth 2.0 客户端凭据)请求应用程序令牌。
在 Google STS 进行交换:客户后端服务在 Google STS 针对项目的 Workload Identity Pool 提供商交换该机器 JWT,磁盘上零密钥。
调用 StreamAssist:客户后端服务将返回的 Google STS 令牌发送给 StreamAssist。
何时使用模式 1C 与模式 1A 和 1B:由于工作负载身份联合验证的是机器而非个人员工,Gemini Enterprise 会将每个请求视为来自同一工作负载身份。对于共享知识库上的非个性化机器人,请使用模式 1C;而在需要每用户文档 ACL、用户特定的 3LO 连接器或受限自定义代理时,请使用模式 1A 或模式 1B。
第二部分:通过自定义 UI 验证联合连接器的身份
一旦客户 UI 和客户后端服务以已登录员工的身份调用 StreamAssist,用户就可以查询原生的联合连接器(如 Google Drive、Microsoft SharePoint Online、Jira、Box、ServiceNow 和 Confluence),这些连接器会实时搜索第三方 API。
由于联合连接器在第三方系统中强制执行用户级权限,每个员工使用三腿 OAuth (3LO) 授权连接器一次。Gemini Enterprise 将其自身的托管密钥库中存储这些每用户刷新令牌,因此客户后端服务无需在自己的数据库中存储第三方凭据。
图 3:组件架构和验证 Gemini Enterprise 联合连接器的 11 步 3LO 流程,涉及客户 UI、客户 BE、3P 认证服务器、GE FE 服务器、GE 服务器和密钥库。
阶段 1:发现连接器并检查密钥库(步骤 1 至 4):客户 UI 向客户后端服务请求可用的连接器(步骤 1)。客户后端服务使用用户的第 1 部分 Bearer 令牌调用 GE 服务器,列出附加到引擎的联合连接器,并检查用户是否对每个连接器都拥有有效的访问令牌(步骤 2)。GE 服务器检查密钥库:如果用户之前已授权该连接器,GE 服务器会自动刷新并返回令牌;否则,它返回一个授权 URL(步骤 3)。客户后端服务将连接器列表返回给客户 UI,后者为任何需要同意的连接器呈现“授权”按钮(步骤 4)。
第二阶段:3LO 同意弹窗与重定向中继(步骤 5 至 7):当用户点击“授权”按钮时,客户界面会在 3P Auth Server 上以弹窗窗口形式打开授权 URL(步骤 5)。用户登录并批准访问后,弹窗会重定向至 Google 的 GE FE Server OAuth 重定向页面(步骤 6),该页面通过浏览器 postMessage 将包含授权码和状态信息的回调 URL 发送回客户界面,并关闭弹窗(步骤 7)。
第三阶段:交换代码、在密钥库中存储刷新令牌并确认(步骤 8 至 11):客户界面将回调 URL 转发给客户后端(步骤 8),后者调用 GE Server 以通过第三方令牌端点交换授权码,并将用户的刷新令牌保存在密钥库内(步骤 9)。GE Server 向客户后端(步骤 10)和客户界面(步骤 11)确认连接器现已获得授权。一旦获得授权,客户后端会在其 StreamAssist 请求中包含连接器的数据存储 ID,以便 Gemini Enterprise 在查询时搜索实时的第三方连接器。
自定义界面的注意事项:启用来自 GE FE Server 的自动弹窗移交:所有 Gemini Enterprise 联合连接器均使用 GE FE Server 上 Google 托管的 /oauth-redirect 端点作为其固定的回调 URL。默认情况下,该页面仅向内置的 Gemini Enterprise Web 应用源发送浏览器 postMessage 事件。当在自定义域上部署客户界面时,请与您的 Gemini Enterprise 团队配合启用自定义来源标志,以便步骤 7 自动将回调 URL 发布给客户界面并关闭弹窗。
原生联合连接器非常适合联合搜索和内置操作。当工作流需要多步推理、自定义 Python 逻辑或在单个助手内协调多个企业 API 时,团队会构建自定义 ADK 智能体,将其部署在 Vertex AI Agent Engine 上,并在 Gemini Enterprise 中注册它。
在 Gemini Enterprise 中注册 ADK 智能体时,直接将静态 OAuth 配置附加到根智能体注册表中,会为自定义界面带来两个问题:
跨所有工具的预先阻塞:根级别的 OAuth 会在第一个回合甚至到达您的智能体代码之前,就限制整个智能体的使用。如果助手同时连接到 Google Drive 和 Microsoft SharePoint Online,用户在询问一般政策问题或仅查询 SharePoint 时,无法避免被迫先完成每一个 OAuth 登录流程。
与内置界面的耦合:根级别智能体授权的设计是围绕内置的 Gemini Enterprise Web UI 进行的,而不是通过 StreamAssist API 返回特定于工具的授权提示。
要按工具按需触发三腿 OAuth(3-Legged OAuth),并让 Gemini Enterprise 和 Google Cloud 自动管理每个用户的令牌库,请遵循以下三个简单的设置步骤:
创建子智能体工具,并在 GcpAuthProvider 中包装受保护的工具:不需要用户登录的标准工具作为普通的 Python 函数运行,零 OAuth 提示。对于调用受保护的第三方 API(如 SharePoint 或 Google Drive)的工具,请使用 ADK 的 AuthenticatedFunctionTool 和 GcpAuthProvider 包装该工具函数,并指向 GCP Auth Manager 中的 Auth Provider 资源。
将 ADK 智能体部署到 Vertex AI Agent Engine,并开启智能体身份验证:启用智能体身份验证,将根路由器智能体及其子智能体部署到 Vertex AI Agent Engine。这将为智能体提供内置的 SPIFFE 身份。授予该智能体身份 GCP 项目中的“智能体身份服务智能体”IAM 角色,以便其能够从 GCP Auth Manager 令牌库中检索令牌。
在 Google Cloud Console(Auth Manager)中添加 3LO Auth Provider:在 Google Cloud Console 中,为每个第三方 OAuth 应用(如 SharePoint 和 Google Workspace)创建一个 3LO Auth Provider,将默认继续 URI 设置为
图4:组件架构以及跨越客户UI、客户后端(Customer BE)、GE服务器、Vertex AI Agent Engine和GCP Auth Manager的19步按需工具3LO流程。
第一阶段:查询路由与Token Vault检查(步骤1至7):用户从客户UI发送提示词至客户后端(步骤1),后者使用用户的Part 1 Bearer令牌调用GE服务器上的StreamAssist API(步骤2)。GE服务器在Vertex AI Agent Engine上调用自定义ADK智能体(步骤3)。在执行受保护工具之前,子智能体会使用其智能体身份通过GCP Auth Manager Token Vault进行检查(步骤4)。在首次调用(缓存未命中)时,GCP Auth Manager返回一个授权URL,该URL依次从Vertex AI Agent Engine流回GE服务器(步骤5)、客户后端(步骤6)以及客户UI(步骤7)。
第二阶段:3LO同意弹窗与回调重定向(步骤8至10):客户UI显示一个“授权”按钮,该按钮在弹窗窗口中打开授权URL,用户在其中登录并在第三方认证服务器(3P Auth Server)上批准访问(步骤8)。3P认证服务器将弹窗重定向至GCP Auth Manager管理的OAuth回调端点,后者将授权代码交换为第三方令牌并暂存以待验证(步骤9)。随后,GCP Auth Manager使用验证状态令牌将弹窗重定向至客户UI上的/validateUserId回调页面(步骤10)。
第三阶段:验证用户授权并将令牌保存至Token Vault(步骤11至14):客户UI将验证状态令牌传递给客户后端并关闭弹窗(步骤11)。客户后端使用该用户的Part 1 Bearer令牌调用GE服务器上的验证用户授权API(步骤12)。GE服务器验证会话所有者,并调用GCP Auth Manager的FinalizeCredentials接口,该接口将用户的3LO令牌永久保存至Token Vault并返回成功(步骤13)。随后,GE服务器向客户后端返回HTTP 200 OK响应(步骤14)。
第四阶段:自动查询重试与缓存执行(步骤15至19):一旦客户后端在步骤14接收到HTTP 200 OK,便会立即在同一会话中自动重试StreamAssist查询(步骤15)。GE服务器在Vertex AI Agent Engine上调用ADK智能体(步骤16),此时该智能体会命中Token Vault缓存,使用3LO令牌调用第三方API(如Microsoft Graph或Google Drive),并通过GE服务器(步骤17)、客户后端(步骤18)和客户UI(步骤19)流式返回基于事实的答案。所有后续查询均在单次交互中完成,无需任何弹窗。
探索可运行的代码蓝图
我们将所有三个认证层以及交互式Web测试UI、CLI脚本和curl命令打包到了gemini-enterprise-custom-ui-auth GitHub仓库中:
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 :
Authenticating to StreamAssist (User Identity vs. Workload Identity): For user-facing applications where document ACLs, isolated chat history, and restricted agent permissions matter, Customer UI and Customer BE must pass the signed-in employee's identity via Google Identity ( Pattern 1A ) or Workforce Identity Federation ( Pattern 1B ). For non-personalized backend bots or shared service portals, Customer BE can authenticate keyless using Workload Identity Federation ( Pattern 1C ).
Authenticating Federated Connectors through Customer UI: Real-time Federated Connectors use 3-Legged OAuth (3LO) so they only retrieve Google Drive files, SharePoint sites, Jira issues, or ServiceNow incidents that the signed-in employee is allowed to see. Because Customer UI does not have Gemini Enterprise's built-in Connect button, Customer BE and Customer UI must discover the engine's connectors, check the Keystore for a valid token, trigger the 3LO consent popup when needed, save the refresh token in the Keystore , and include the connector data stores in StreamAssist queries.
Handling per-tool OAuth for custom ADK agents: When deploying a custom ADK agent on Vertex AI Agent Engine that connects to multiple enterprise systems (such as Google Drive and Microsoft SharePoint), attaching static OAuth configs at the root agent registration level blocks the entire agent upfront. Instead, by wrapping protected sub-agent tools with GcpAuthProvider (backed by GCP Auth Manager's Token Vault ) and deploying the agent with Agent Identity turned on, StreamAssist triggers an on-demand 3LO popup only when a protected tool is called.
This guide walks through the architecture, component flows, and runnable code for all three layers ( Figure 1 ):
Figure 1: End-to-end authentication architecture across StreamAssist login (Google Identity, Workforce STS, or Workload STS), Federated Connectors (Keystore), and custom ADK agents (Vertex AI Agent Engine + GCP Auth Manager Token Vault).
Part 1: Three patterns to authenticate to StreamAssist (User & Workload)
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:
Figure 2: Comparing Pattern 1A (Pure Google Identity), Pattern 1B (Workforce Identity Federation + Google STS), and Pattern 1C (Workload Identity Federation + Google STS) for calling StreamAssist.
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.
Pattern 1A: Pure Google Identity (Google Login UI to StreamAssist)
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:
Customer UI signs the employee in using Google Identity Services (OAuth 2.0) with the Google Cloud Platform scope.
Google returns a user access token scoped to the signed-in employee.
Customer BE sends that Bearer token directly to the StreamAssist API.
Pattern 1B: Workforce Identity Federation (External IdP UI to Google STS to StreamAssist )
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:
Register Customer UI on the existing WIF Provider: Add the custom web app's Entra ID or Okta Client ID to the Google Cloud Workforce Pool OIDC Provider.
Exchange the IdP token at Google STS: After the employee signs into Customer UI and receives an OIDC token from Entra ID or Okta, Customer BE exchanges that token at Google Security Token Service (STS) against the Workforce Pool Provider.
Call StreamAssist with the federated user token: Google STS returns a short-lived Google access token representing that specific Workforce Pool user, enforcing all of the employee's group permissions and document ACLs.
Pattern 1C: Workload Identity Federation (Backend / Shared Bot to Google STS to StreamAssist)
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 :
Obtain a machine JWT from the external IdP: Customer BE requests an application token from the external IdP (for example, using OAuth 2.0 client credentials in Entra ID).
Exchange at Google STS: Customer BE exchanges that machine JWT at Google STS against the project's Workload Identity Pool Provider with zero keys on disk.
Call StreamAssist: Customer BE sends the returned Google STS token to StreamAssist.
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.
Part 2: Authenticating Federated Connectors through a custom UI
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.
Figure 3: Component architecture and 11-step 3LO flow for authenticating a Gemini Enterprise Federated Connector across Customer UI, Customer BE, 3P Auth Server, GE FE Server, GE Server, and Keystore.
Phase 1: Discover connectors and check Keystore (Steps 1 to 4): Customer UI requests the available connectors from Customer BE ( Step 1 ). Customer BE calls GE Server with the user's Part 1 Bearer token to list the Federated Connectors attached to the engine and check whether the user already has a valid access token for each connector ( Step 2 ). GE Server checks the Keystore : if the user has authorized the connector before, GE Server refreshes and returns the token automatically; if not, it returns an authorization URL ( Step 3 ). Customer BE returns the connector list to Customer UI , which renders an Authorize Button for any connector that needs consent ( Step 4 ).
Phase 2: 3LO consent popup and redirect relay (Steps 5 to 7): When the user clicks the Authorize Button , Customer UI opens the authorization URL in a popup window at the 3P Auth Server ( Step 5 ). After the user signs in and approves access, the popup redirects to Google's GE FE Server OAuth redirect page ( Step 6 ), which sends the callback URL (containing the authorization code and state) back to Customer UI via browser postMessage and closes the popup ( Step 7 ).
Phase 3: Exchange code, store refresh token in Keystore, and confirm (Steps 8 to 11): Customer UI forwards the callback URL to Customer BE ( Step 8 ), which calls GE Server to exchange the authorization code with the third-party token endpoint and save the user's refresh token inside the Keystore ( Step 9 ). GE Server confirms to Customer BE ( Step 10 ) and Customer UI ( Step 11 ) that the connector is now authorized. Once authorized, Customer BE includes the connector's data store ID in its StreamAssist requests so Gemini Enterprise searches the live third-party connector at query time.
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:
Upfront blocking across all tools: Root-level OAuth gates the entire agent before the first turn even reaches your agent code. If an assistant connects to both Google Drive and Microsoft SharePoint Online , a user cannot ask a general policy question or query just SharePoint without being forced through every OAuth login upfront.
Built-in UI coupling: Root-level agent authorization is designed around the built-in Gemini Enterprise web UI rather than returning tool-specific authorization prompts over the StreamAssist API.
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:
Create sub-agent tools and wrap protected tools in GcpAuthProvider: Standard tools that do not need user login run as normal Python functions with zero OAuth prompts. For tools that call protected third-party APIs (such as SharePoint or Google Drive), wrap the tool function in ADK's AuthenticatedFunctionTool and GcpAuthProvider pointing to the Auth Provider resource in GCP Auth Manager.
Deploy the ADK agent to Vertex AI Agent Engine with Agent Identity turned on: Deploy the Root Router Agent and its sub-agents to Vertex AI Agent Engine with Agent Identity enabled. This provides a built-in SPIFFE identity for the agent. Grant that agent identity the Agent Identity Service Agent IAM role on the GCP project so it can retrieve tokens from the GCP Auth Manager Token Vault .
Add a 3LO Auth Provider in Google Cloud Console (Auth Manager): In the Google Cloud Console, create a 3LO Auth Provider for each third-party OAuth app (such as SharePoint and Google Workspace), set the Default Continue URI to
Figure 4: Component architecture and 19-step on-demand tool 3LO flow across Customer UI, Customer BE, GE Server, Vertex AI Agent Engine, and GCP Auth Manager.
Phase 1: Query routing and Token Vault check (Steps 1 to 7): The user sends a prompt from Customer UI to Customer BE ( Step 1 ), which calls the StreamAssist API on GE Server with the user's Part 1 Bearer token ( Step 2 ). GE Server invokes the custom ADK agent on Vertex AI Agent Engine ( Step 3 ). Before running the protected tool, the sub-agent checks the GCP Auth Manager Token Vault using its Agent Identity ( Step 4 ). On a first-time call (cache miss), GCP Auth Manager returns an authorization URL, which flows back from Vertex AI Agent Engine to GE Server ( Step 5 ), Customer BE ( Step 6 ), and Customer UI ( Step 7 ).
Phase 2: 3LO consent popup and callback redirect (Steps 8 to 10): Customer UI displays an Authorize Button that opens the authorization URL in a popup window, where the user signs in and approves access at the 3P Auth Server ( Step 8 ). The 3P Auth Server redirects the popup to GCP Auth Manager's managed OAuth callback endpoint, which exchanges the authorization code for third-party tokens and holds them pending validation ( Step 9 ). GCP Auth Manager then redirects the popup to the /validateUserId callback page on Customer UI with a validation state token ( Step 10 ).
Phase 3: Validate user authorization and save token in Token Vault (Steps 11 to 14): Customer UI passes the validation state token to Customer BE and closes the popup ( Step 11 ). Customer BE calls the Validate User Authorization API on GE Server with the user's Part 1 Bearer token ( Step 12 ). GE Server verifies the session owner and calls FinalizeCredentials on GCP Auth Manager , which permanently saves the user's 3LO token in the Token Vault and returns success ( Step 13 ). GE Server then returns HTTP 200 OK to Customer BE ( Step 14 ).
Phase 4: Automatic query retry and cached execution (Steps 15 to 19): As soon as Customer BE receives HTTP 200 OK in Step 14, Customer BE automatically retries the StreamAssist query on the same session ( Step 15 ). GE Server invokes the ADK agent on Vertex AI Agent Engine ( Step 16 ), which now gets a Token Vault cache hit, calls the third-party API (such as Microsoft Graph or Google Drive) with the 3LO token, and streams the grounded answer back through GE Server ( Step 17 ), Customer BE ( Step 18 ), and Customer UI ( Step 19 ). All subsequent queries run in a single turn with no popups.
Explore the runnable code blueprint
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 :
| 刊期 | 得分 | 排名 | 结果 |
|---|---|---|---|
| 2026-11-29 | 8.4 | 15 | 入选 |
| 2026-11-28 | 8.4 | 28 | 未入选 |
| 2026-11-27 | 8.4 | 35 | 未入选 |
| 2026-11-26 | 8.4 | 39 | 未入选 |
| 2026-11-25 | 8.4 | 36 | 未入选 |
| 2026-11-24 | 8.4 | 32 | 未入选 |
| 2026-11-23 | 8.4 | 23 | 未入选 |
| 2026-11-22 | 8.4 | 27 | 未入选 |
| 2026-11-21 | 8.4 | 40 | 未入选 |