acoustic-carpenter-78188
04/16/2026, 7:04 AMauthCfg.AppAuth.AuthServerType is External, and externalAuthServer.baseUrl points at the issuer whose .well-known/oauth-authorization-server + jwks_uri v2 reads at boot.
graph TB
Client[UI / flyte-sdk / task pods]
ALB["Ingress / load balancer"]
IDP["OIDC IdP (Okta)<br/>signin.example.com<br/>client id 0oak...5d6"]
AUTHSRV["External OAuth2 authorization server<br/>.well-known/oauth-authorization-server<br/>jwks_uri"]
MW["runs GetAuthenticationHTTPInterceptor<br/>bearer + cookie + loopback gate"]
OIDC["OIDC browser handlers<br/>/login /callback /logout<br/>.well-known/openid-configuration"]
RPC["v2 connect-rpc handlers<br/>RunService ProjectService TaskService<br/>TriggerService TranslatorService<br/>AuthMetadataService IdentityService ..."]
INT["intra-cluster connect-rpc<br/>ActionsService InternalRunService<br/>(ClusterIP only, allowlisted)"]
COOKIE["CookieManager<br/>AES-256 + HMAC-SHA256<br/>cookie_hash_key cookie_block_key"]
S1["auth secret<br/>cookie_hash_key / cookie_block_key"]
S2["OIDC client secret<br/>oidc_client_secret"]
Client --> ALB
ALB -->|"/login /callback /logout /healthcheck<br/>/flyteidl2.*/*"| MW
ALB -.->|"/v2/* static SPA"| MW
Client -.->|"task-pod ClusterIP calls"| INT
MW --> OIDC
MW --> RPC
OIDC <-->|"authorization code flow"| IDP
OIDC --> COOKIE
MW -.->|"boots JWKS"| AUTHSRV
MW -.->|"validate bearer token signature"| AUTHSRV
COOKIE -.->|"reads"| S1
OIDC -.->|"reads"| S2
Loading
Component data flow
| Component | File(s) | Reads | Writes / Emits | When |
| ----------------------------------------- | -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------ |
| setupAuth() bootstrap | runs/setup.go | /etc/secrets/cookie_hash_key, /etc/secrets/cookie_block_key, /etc/secrets/oidc_client_secret, authCfg.AppAuth.ExternalAuthServer.BaseURL | *AuthenticationContext, registers 4 HTTP handlers + connect-rpc services, sets sc.Middleware | Once at pod start |
| ResourceServer | runs/service/auth/authzserver/resource_server.go | configured issuer .well-known/oauth-authorization-server then jwks_uri then JWKS | verifies JWT signature, parses claims, returns *IdentityContext | Once at boot (JWKS fetch), then per-request (verify) |
| GetAuthenticationHTTPInterceptor | runs/service/auth/http_middleware.go | req.URL.Path, req.Header.Get("Authorization"), request cookies, req.RemoteAddr | injects IdentityContext into ctx, writes 401, or bypasses auth for loopback and public paths | Every non-public request |
| IsPublicPath | same file | req.URL.Path | skips middleware for health probes, OIDC flow paths, AuthMetadataService, ActionsService, InternalRunService | Every request |
| isLoopbackRequest | same file | req.RemoteAddr | bypasses middleware for intra-process connect-rpc calls from the unified binary to its own mux | Every non-public request |
| IdentityContextFromRequest | runs/service/auth/handlers.go | Authorization: Bearer ... header then ResourceServer.ValidateAccessToken, or cookies then CookieManager.RetrieveTokenValues then IdentityContextFromIDToken | *IdentityContext or error | Called by middleware |
| CookieManager | runs/service/auth/cookie_manager.go | cookie_hash_key + cookie_block_key (base64, at startup); flyte_at / flyte_rt / flyte_idt / flyte_user_info cookies (per request) | encrypted cookies on /login+/callback, decrypted payloads on middleware pass | Startup + per request |
| GetLoginHandler | runs/service/auth/handlers.go | redirect_url query param | sets flyte_csrf_state cookie; 307 to oauth2Config.AuthCodeURL(state) | When client hits /login |
| GetCallbackHandler | runs/service/auth/handlers.go | code + state query params, flyte_csrf_state cookie, oidc_client_secret | exchanges code at IdP, fetches user info, sets flyte_at/flyte_rt/flyte_idt/flyte_user_info cookies, 307 to post-login redirect | When IdP redirects back |
| computeOIDCRedirectURL | runs/service/auth/auth_context.go | cfg.AuthorizedURIs[0] | returns absolute URL like https://<host>/callback | At NewAuthContext time, baked into oauth2.Config.RedirectURL |
| authzserver.NewAuthMetadataService | runs/service/auth/authzserver/metadata_provider.go | authCfg.AppAuth.ExternalAuthServer.BaseURL + .MetadataEndpointURL | serves /flyteidl2.auth.AuthMetadataService/GetOAuth2Metadata and GetPublicClientConfig via connect-rpc | Client discovery calls |
| Helm configmap.yaml renders 004-auth.yaml | charts/flyte-binary/templates/configmap.yaml | configuration.auth.* values …
flyteorg/flyteacoustic-carpenter-78188
04/16/2026, 7:04 AM