Skip to content

Add Modal OIDC authentication (oidc-modal)#20

Open
luiscape wants to merge 12 commits intomainfrom
luis/oidc-auth
Open

Add Modal OIDC authentication (oidc-modal)#20
luiscape wants to merge 12 commits intomainfrom
luis/oidc-auth

Conversation

@luiscape
Copy link
Copy Markdown
Member

Adds passwordless authentication to vprox using Modal's OIDC identity tokens. Setting VPROX_AUTH_MODE=oidc-modal on the server enables JWT verification against Modal's OIDC issuer — on startup, the server performs OIDC discovery, fetches the JWKS signing keys, and validates every incoming token's signature, expiry, issuer, and optionally audience and workspace ID. On the client side, Modal injects MODAL_IDENTITY_TOKEN into containers automatically; the client passes it to vprox via VPROX_OIDC_TOKEN="$MODAL_IDENTITY_TOKEN".

The auth mode is explicitly named oidc-modal rather than generic oidc since the token claims are Modal-specific (workspace ID, environment, app, function, container). All configuration uses the VPROX_ prefix. Access control is scoped to workspace IDs only (VPROX_OIDC_ALLOWED_WORKSPACE_IDS), with a * wildcard option that logs a warning for testing use.

@luiscape luiscape requested review from abhagwat and pawalt March 15, 2026 15:23
@luiscape luiscape requested a review from AmitPr March 23, 2026 14:31
@luiscape luiscape self-assigned this Mar 24, 2026

// Verify Modal workspace claim.
if len(a.oidc.AllowedWorkspaceIDs) > 0 {
if !stringInSlice(claims.WorkspaceID, a.oidc.AllowedWorkspaceIDs) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit nervous about this check: it should be highly unlikely, if not impossible, for e.g. a workspace ID to be a prefix of another. But can we just do a strict check here? ie split a.oidc.AllowedWorkspaceIDs by commas, put them in a hashset/list, and check that claims.WorkspaceID belongs to that set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants