OAuth 2.1, PKCE, and API keys
RFC 9700 user flows, short-lived JWTs, and hashed machine credentials under ADP-043.
Credential design defaults
Separate interactive user delegation from server-to-server integration keys.
| Mechanism | Recommended standard | Lifetime & storage | Rule |
|---|---|---|---|
| User-facing OAuth flow | Auth Code + S256 PKCE | Access token 5 to 15 min | ADP-043 |
| Refresh tokens | Single-use rotation | Reuse triggers family revocation | ADP-043 |
| JWT verification | EdDSA or RS256 JWKS | Key rotation via kid claim | ADP-043 |
| Machine API keys | Prefixed token + scopes | Salted SHA-256 hash in DB | ADP-016 |
| Transport security | Bearer or header auth only | No query string secrets | ADP-015 |
OpenAPI 3.1 security scheme block
"securitySchemes": {
"BearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" },
"ApiKeyHeader": { "type": "apiKey", "in": "header", "name": "X-API-Key" }
}Pair auth with tenant scoping
Run --preset owasp-api-top10 and follow object authorization rules in the OWASP API Security Checklist.