Authorization: Bearer <token> header. Tokens are signed with RS256 and verified against the Keycloak JWKS endpoint derived from the token’s iss claim.
The platform supports three authentication methods: Supabase-backed email/password (primary), Keycloak SSO (for multi-client deployments), and FIDO/WebAuthn passkeys. All methods ultimately produce a Keycloak-issued JWT.
Registration and login flow
Request a verification email
Send the user’s email address to receive a one-time verification code.An optional
clientAlias query parameter targets a specific SSO client. If omitted, the default client is used.Token refresh
Access tokens expire after the duration specified inexpires_in (seconds). Use the refresh token returned at sign-in to obtain a new access token without requiring the user to re-authenticate.
Sign out
Invalidate the current session server-side. Requires a valid Bearer token.curl
Password reset
- Forgot password
- Reset with token
- Reset while authenticated
Request a password-reset link sent to the user’s email.
curl
Auth providers
- Supabase
- Keycloak SSO
- FIDO / WebAuthn
Supabase is the primary identity backend. The platform uses
SUPABASE_URL, SUPABASE_KEY, and SUPABASE_JWT_SECRET to verify tokens and manage user records.Set these three variables in .env:.env
Multi-client SSO (clientAlias)
The platform can serve multiple front-end clients from a single backend. Each client has its own Keycloak management credentials and post-login redirect domain. The clientAlias concept ties a request to a specific client.
How it works:
SUPPORTED_SSO_CLIENTSlists all enabled client names (comma-separated).- For each name, four environment variables are expected:
{NAME}_CLIENT_ALIAS— short alias token{NAME}_DOMAIN— post-login redirect URL{NAME}_KEYCLOAK_MANAGEMENT_CLIENT_ID— encrypted client ID{NAME}_KEYCLOAK_MANAGEMENT_CLIENT_SECRET— encrypted client secret
- The
GET /auth/clientAliasesendpoint returns all configured aliases and their domains. - Auth endpoints that accept a
clientAliasquery parameter (e.g.,POST /auth/verification-mail) use the alias to select the correct Keycloak client for the operation.
.env
CREDEBL_KEYCLOAK_MANAGEMENT_CLIENT_ID and _SECRET values must be encrypted using CRYPTO_PRIVATE_KEY before being stored in .env. Use the same encryption key as configured in the Studio UI.Session management
The platform tracks sessions server-side. Asid claim in the JWT is validated against the session store on every authenticated request (see JwtStrategy.validate). A token whose session has been revoked is rejected with 401 Unauthorized.
| Endpoint | Method | Description |
|---|---|---|
/auth/{userId}/sessions | GET | List all active sessions for a user |
/auth/{sessionId}/sessions | DELETE | Revoke a specific session by ID |
Users can only view and revoke their own sessions. Attempting to access another user’s sessions returns
403 Forbidden.HTTP error reference
| Status | Meaning | Common causes and resolution |
|---|---|---|
401 Unauthorized | Missing or invalid token | Token absent, expired, malformed, or the session has been revoked. Sign in again to obtain a fresh token. |
403 Forbidden | Authenticated but not authorized | The token is valid but the user lacks the required role or org permission for the requested resource. Check the user’s organization role assignment. |
404 Not Found (from auth) | User record not found | The sub claim in the JWT does not match any user in the database. This can occur after user deletion or an identity provider misconfiguration. |