Blog post: The OIDC edge gateway: validating tokens you did not issue
Token validation
- Resolve discovery and JWKS from the trusted issuer.
- Validate signature, issuer, expiry, and not-before time.
- Enforce the route-specific audience and scopes.
- Return 401 for missing or invalid authentication and 403 for insufficient authorization.
- Use introspection only where rapid revocation detection is required; cache briefly and fail closed.
Trusted identity propagation
Strip every client-supplied identity or forwarding header before routing. Derive downstream identity headers only from validated claims, including subject, username, roles, and client ID. Do not forward bearer tokens unless the downstream contract explicitly requires them.
Route policy
Keep audience, scopes, rate limit, introspection, timeout, and cache policy in route configuration. Deny direct access to internal upstream paths so callers cannot bypass the edge authorization contract.
Resilience
Rate-limit by identity rather than shared office IP where possible. Retry only idempotent operations. Bound connection and response timeouts. Treat response caching as optional, honor no-store, private, and Set-Cookie, and fail open to pass-through when the cache is unavailable.