Implement OAuth Consent Flow
Wacht exposes a clean consent flow contract with three endpoints. This is one of the few places where frontend calls are intentionally direct; app/client provisioning and token operations should still use backend SDKs.Consent flow sequence
- Redirect user to
GET /oauth/consent/init?handoff_id=... - Fetch consent data from
GET /oauth/consent/details - Submit decision to
POST /oauth/consent/submit
Step 1: Initialize consent
Step 2: Load consent details
Step 3: Submit approve or deny
UX requirements for production
- Show human-readable scope descriptions (
scope_definitions). - Always show target resource and app/client identity.
- Handle consent expiry (
expires_at) with retry path. - Require explicit action for destructive scopes.
Security requirements
- Use cookie session auth (
credentials: include) for consent endpoints. - Enforce CSRF token usage on submit.
- Do not auto-approve hidden scopes.
- Log user, client, scopes, resource, and decision.
