This article is a technical commentary and implementation example created using AI. Although the code and procedures presented are based on primary sources, the author has not verified their operation on actual hardware. Operation may vary depending on the environment and version.
Reviewing How to Carry User Identity Across Federated Kubernetes and AI Platforms from Official Sources
Modern AI platforms and distributed data infrastructures require integrating workflows spanning multiple clusters and cloud environments, rather than just a single application behind a single login screen. Users access data from a central portal, launch notebooks, and utilize AI assistants that invoke services on separate clusters. This creates a need for a secure and reliable way to carry user identity across the boundaries of control planes and data planes. Based on the primary source “How to Carry User Identity Across Federated Kubernetes and AI Platforms” published on the NVIDIA Technical Blog, this article outlines the challenges of user identity propagation in distributed Kubernetes and AI platforms and the centralized identity gateway pattern that solves them.
Background and Challenges from Primary Sources
In modern AI workflows, data and compute resources are located close to where they are generated, stored, and governed. Even when workflows are distributed across multiple regional clusters, different clouds, on-premises environments, or dedicated execution planes, users expect a consistent platform experience across notebooks, catalogs, query tools, dashboards, and AI assistants.
While traditional Single Sign-On (SSO) is effective for entry-point authentication, it falls short when carrying context directly into the data plane or distributed environments. Transferring raw SSO tokens to all applications expands the surface area of credential exposure, complicates revocation handling, and forces each cluster to individually implement Identity Provider (IdP) integrations.
Below are the structural problems that occur in a distributed session ownership model.
sequenceDiagram
participant User as User
participant GW1 as Regional Gateway A
participant GW2 as Regional Gateway B
participant IdP as Identity Provider
User->>GW1: Access Tool A
GW1->>IdP: Independent OIDC redirect and login
IdP-->>GW1: Issue token & create Session A
User->>GW2: Access Tool B
GW2->>IdP: Separate independent OIDC redirect and login
IdP-->>GW2: Issue separate token & create Session B
Challenges of the Distributed Session Ownership Model
Session Fragmentation: State is not recognized outside the gateway that issued the token, leading to re-authentication per service rather than across the entire platform.
Logout Locality: Signing out of one tool leaves active sessions in other locations, creating security risks and confusion.
Asynchronous Token Refresh: Each gateway individually handles refresh processes with the upstream IdP, causing increased load and state mismatches.
Inconsistent Identity Context: Token interpretation and authentication logic are duplicated and scattered across downstream services.
Lack of Scalability: Every time a new tool is added, a similar authentication infrastructure integration must be redone.
Comparison of Two Identity Patterns
The primary source compares two identity structures in federated platforms: “Distributed session ownership” and “Centralized session ownership.”
| Architectural Choice | Distributed Session Ownership | Centralized Session Ownership |
|---|---|---|
| Login Experience | May require re-login per tool or gateway | Single login per platform session |
| Logout Behavior | Localized per service or cluster | Propagates platform-wide through a single session record |
| Token Refresh | Each gateway handles iteratively and independently | Managed cooperatively by a central gateway |
| Load on Upstream IdP | Scales with the number of users, tools, and clusters | Scales primarily with the number of active users |
| Downstream Identity | Prone to duplication and inconsistency | Standardized via trusted headers and claims |
| Operational Model | Simple initially, but complexity grows at scale | Requires a central service, but adding new tools is simplified |
While the centralized pattern is not mandatory for all applications, it delivers high value when users move across multiple tools, clusters, and regions within a single workflow and expect them to operate as a cohesive platform.
Components of the Centralized Identity Gateway Pattern
The centralized identity gateway pattern described in the primary source is an architecture that decouples session ownership from request enforcement.
This pattern consists of the following key components and roles:
1. Single Session Owner (Central Identity Gateway)
Creates and manages sessions across the entire platform. It handles the OpenID Connect (OIDC) authorization code flow and stores acquired sessions with a Time-To-Live (TTL) in a shared store such as Redis.
2. Minimal Verification Endpoint (/gateway/userinfo)
A lightweight side-call API used by data plane gateways in each region to query user identity. It avoids raw token transfers and centrally verifies session validity.
3. Stateless Regional Gateways
Deployed in each cluster, delegating session verification itself to the central gateway while enforcing local policies and injecting verified, trusted identity headers.
4. Shared Session Store and Browser Cookies
Maintains session IDs using secure HttpOnly cookies scoped to the platform domain, and shares session states via backend Redis or similar storage.
5. Platform-Wide Single Logout
By deleting the session record on the central identity gateway side, all regional gateways instantly detect invalid sessions on the next request, prompting access denial or re-login.
How the Request Flow Works
The basic request processing flow in the centralized gateway is categorized into three parts: login, verification, and token refresh/logout.
Login Flow: When a user without a valid platform session accesses a regional gateway, they are redirected to the central identity gateway. The central gateway completes the OIDC flow with the IdP, stores the session in Redis, and issues an HTTP-only session cookie.
Verification Flow (Per-request validation): For subsequent requests, the regional gateway sends the session cookie to
/gateway/userinfo, and the central gateway looks up the session and returns claims such as user ID, email, groups, and roles. The regional gateway uses this to attach standardized identity headers to downstream services.Token Refresh and Logout: When access tokens approach expiration, the central gateway performs a refresh using the retained refresh token and synchronizes the state on the shared store. Upon logout, the central session record is deleted, resulting in immediate invalidation across all gateways.
Security and Reliability Guardrails
When centralizing the architecture, the identity gateway itself becomes a critical component. Therefore, the primary source outlines the following security and reliability guardrails:
Inter-Service Authentication: Use mutual TLS (mTLS), workflow identities, or signed internal tokens between regional gateways and the central identity gateway to prevent unauthorized callers from accessing the verification endpoint.
Header Sanitization: Always discard inbound identity headers sent from clients, and newly inject only trusted headers at the gateway layer.
Session Store Protection: Store only the minimum information necessary for the platform in session records, apply short-lived access tokens, explicit session TTLs, encryption in transit, and appropriate access controls.
Defining Failure Behavior: Clarify behavior when the identity gateway or session store is unavailable (e.g., fail-closed design denying all requests, or introducing short-lived cache verification for resilience).
Audit Logging: Centrally record verification, refresh, and logout events to generate a reliable audit trail of who accessed which service.
Application and Benefits to Platform Development
Implementation within NVIDIA’s internal development platform (Kubernetes clusters spanning AWS and OCI) notes that repeated login events were reduced by 55% through this approach.
Applying this pattern yields the following effects and benefits:
Reduced Load on Upstream IdP: Achieves scalability proportional to the number of active users rather than the combination of users, tools, and clusters.
Integration of AI and Data Workflows: Enables building foundations for unified platform shells and AI assistants operating with delegated user identities. This makes it possible for AI assistants to inherit the user’s RBAC (Role-Based Access Control) scope when calling backend tools.
Gradual Migration Model: Allows migrating gateways and services one by one instead of modifying all systems at once.

コメント