Auth and Identity
OPS Platform v2 supports Supabase/OIDC-oriented auth, bearer tokens, cookies, and API keys.
Backend auth inputs
Implemented in:
backend/core-api/app/core/auth.pybackend/core-api/app/core/api_key_auth.pybackend/core-api/app/core/rbac_deps.pybackend/core-api/app/core/rbac_config.py
Accepted auth forms:
Authorization: Bearer <jwt>access_tokencookieX-API-Key
OpenAPI security schemes are registered in backend/core-api/app/main.py:
BearerAuthApiKeyAuth
Provider modes
AUTH_PROVIDER_MODE supports:
supabase_dualsupabase_onlylegacy_custom
Identity mapping convention
Canonical authenticated user id resolution priority from AGENTS.md:
user_iduser_uuidsub
Use profile DID mapping for OIDC identity linking where applicable. Be careful with UUID-only DB fields: do not assume every sub is a UUID.
Frontend auth paths
apps/webapp/src/app/auth/login/route.tsapps/webapp/src/app/auth/callback/route.tsapps/webapp/src/app/auth/refresh/route.tsapps/webapp/src/app/auth/logout/route.tsapps/webapp/src/app/auth/supabase/session/route.tsapps/webapp/src/lib/oidc.ts