Authentication
Terra uses WorkOS AuthKit for authentication, decoupling identity from the database.
Why WorkOS?
Government agencies often require enterprise SSO (SAML, OIDC) with Azure AD, Okta, or Google Workspace. WorkOS makes this configuration, not code.Authentication Flow
Session Management
Sessions are stored as encrypted cookies:- Encrypted with
WORKOS_COOKIE_PASSWORD - HttpOnly (no JavaScript access)
- Secure (HTTPS only in production)
- 7-day expiry
User Sync
On first login, we sync WorkOS user data touser_profiles: