Routes¶
Auth middleware exposes four HTTP endpoints.
GET /auth — OIDC authentication¶
Handles the initial authentication when a user accesses a workspace via OIDC.
Flow:
The reverse proxy forwards the request (with OIDC headers set by the IdP integration).
The middleware extracts the OIDC token from the
Authorizationheader.It verifies the token with the configured OIDC provider.
It extracts the user identity (username, groups, UID) from the OIDC claims.
It calls
ConnectionAccessReviewon the Extension API to check workspace authorization.On success, it generates a JWT session cookie scoped to the workspace path.
It returns 200 OK — the proxy forwards the original request to the workspace.
Error responses:
401— missing or invalid OIDC token403— user not authorized for this workspace
GET /bearer-auth — Bearer token authentication¶
Handles authentication via a pre-signed bearer token URL.
Flow:
A user opens a bearer token URL (generated by the Extension API).
The reverse proxy forwards the request to
/bearer-auth.The middleware extracts the
tokenquery parameter from the forwarded URI.It calls
BearerTokenReviewon the Extension API to validate the token and get the user identity.It verifies the token’s path matches the request path.
On success, it generates a long-lived JWT session cookie.
It returns 200 OK.
Error responses:
400— missing token parameter401— token not authenticated403— token path mismatch
GET /verify — Session verification¶
Called by the reverse proxy on every request to a workspace.
Flow:
The middleware extracts the JWT session cookie scoped to the workspace path.
It validates the token signature, expiration, path prefix, and domain.
If the token is within the refresh window, it re-checks authorization via
ConnectionAccessReviewon the Extension API and issues a refreshed token.It returns 200 OK — the proxy forwards the request.
Token refresh behavior:
If the access review fails transiently, the middleware marks the token as skip-refresh and continues (the user’s session remains valid until expiry).
If the access review explicitly denies access, the middleware clears the cookie and returns 403.
Error responses:
401— no cookie, invalid token, or expired token403— path or domain mismatch, or access revoked during refresh
GET /health — Health check¶
Returns 200 OK when the server is running. Used by Kubernetes liveness and readiness probes.