-
Notifications
You must be signed in to change notification settings - Fork 196
Description
Overview
This epic tracks the implementation of RFC-0052: adding multi-upstream Identity Provider (IDP) support to the embedded OAuth authorization server (pkg/authserver/). The auth server currently hard-rejects more than one upstream provider configuration; this feature lifts that restriction by adding a providerName dimension to the storage layer and introducing a sequential authorization chain so a single auth server instance can acquire tokens from multiple upstream IDPs in one flow.
Background
Multi-upstream IDP support is a prerequisite for the full vMCP auth story. Without it, backends requiring credentials from different IDPs (e.g., a corporate SSO token for internal services and a GitHub token for public APIs) cannot be served by a single auth server instance. The RFC specifies a server-driven sequential authorization chain, eager token loading into Identity.UpstreamTokens at middleware time, and full backward compatibility for existing single-upstream deployments.
Task Breakdown
| Task ID | Title | Depends On | GitHub Issue # |
|---|---|---|---|
| TASK-001 | Phase 1: Storage Layer | — | #4136 |
| TASK-002 | Phase 2: Handler and Server Layer | TASK-001 | #4137 |
| TASK-003 | Phase 3: Config and Operator | TASK-001 | #4138 |
| TASK-004 | Phase 4: Identity Enrichment and upstreamswap Middleware | TASK-001 | #4139 |
Acceptance Criteria
- A single auth server instance accepts and validates configuration with multiple upstream OAuth2/OIDC providers
- Sequential authorization chain drives the user through each configured upstream in turn; the client makes one
GET /oauth/authorizeand receives one authorization code - All upstream tokens are eagerly loaded into
Identity.UpstreamTokensat auth middleware time -
upstreamswapmiddleware reads upstream tokens fromIdentity.UpstreamTokenswith no hidden storage calls - Single-upstream deployments continue to work with no configuration changes required
- Redis breaking change (key pattern) and
ProviderIdentitybreaking change documented in migration guide - All linked task issues completed
References
- RFC-0052: https://github.com/stacklok/toolhive-rfcs/blob/main/rfcs/THV-0052-multi-upstream-idp-authserver.md
- Related stacklok-epics issue: https://github.com/stacklok/stacklok-epics/issues/251