Trigger.dev shares design lessons from building an OIDC issuer
Brief
Trigger.dev shares implementation guidance for teams building OIDC issuers for CI systems, job runners, and serverless platforms.
Bind identity to real boundaries
- Only issue an OIDC token when its run is still executing and the request token belongs to the current attempt.
- Use separate signing keys for run tokens and OIDC tokens; Trigger.dev signs OIDC tokens with RS256 and 2048-bit RSA keys.
- Build subjects from IDs that are never reused, and make the subject reflect the platform’s actual isolation boundaries.
Keep issuer configuration stable
- Trigger.dev gives each organization its own issuer URL and says not to change it after customers configure it as trusted.
- The discovery document’s issuer must exactly match the token’s iss claim, including a trailing slash if present.
- Only issue tokens to deployed runs; keep wildcards at the end of subjects and prevent segment values from containing the delimiter.
Rotate keys around verifier caches
- Publish a new public key alongside the old one, wait for caches to receive it, then begin signing with it.
- Keep the old key published until tokens signed with it have expired, then remove it.
- Trigger.dev says its token lifetimes are capped at 24 hours, so retired keys remain published for just over a day, even though task tokens last 5 minutes.
Generated by AI from the original article. Check the source for full details.