Auth Guide
Overview
The SYSTEM auth domain covers every pre-login and session-establishment flow used by administrators and internal operators. In practice, a full auth journey usually combines secure-channel bootstrap, an auth endpoint under /web/v1/tenant/auth/*, and one or more follow-up account calls once JWT tokens are issued.
Portal-Specific Context
SYSTEM is a web-chain portal. Pre-login calls do not require a JWT, but they do require the portal ingress header and usually an encrypted request body carried over a secure-channel session.
Common Prerequisites
- valid TENANT portal access code
- a stable
X-Client-Hashgenerated by the frontend session - secure-channel bootstrap for endpoints that accept encrypted bodies
- support for storing
accessTokenandrefreshToken
Shared Headers
X-PORTAL-ACCESS-CODE: <system-portal-code>
X-Client-Hash: <browser-fingerprint>
Content-Type: application/jsonAdd this header for encrypted request bodies:
X-Secure-Channel-Session-Id: <secure-channel-session-id>Add this header after login succeeds:
Authorization: Bearer <accessToken>Secure-Channel Bootstrap
Use these public endpoints before sending encrypted auth payloads:
GET /web/v1/secure-channel/public-keyPOST /web/v1/secure-channel/sessionPOST /web/v1/secure-channel/session/close
This path is notable because it is not namespaced under /web/v1/tenant/, even though it is required by SYSTEM login, password, and some account-security flows.
Primary Sub-Flows
1. Login
Use Login Flow when the user already has credentials.
Core calls:
POST /web/v1/tenant/auth/login/initiatePOST /web/v1/tenant/auth/login/mfa/sendPOST /web/v1/tenant/auth/login/complete
Outputs:
- login session ID
- selected MFA method
accessTokenandrefreshToken
2. Registration
Use Registration Flow when SYSTEM self-registration is enabled for a controlled deployment or internal onboarding program.
Typical stages:
- create a registration session
- verify email ownership
- complete account creation
- initialize a password when required
3. Password Lifecycle
Use Password Flow for recovery, first-time setup, and authenticated password rotation.
Core calls:
POST /web/v1/tenant/auth/password/forgotPOST /web/v1/tenant/auth/password/resetPOST /web/v1/tenant/auth/password/initPOST /web/v1/tenant/auth/password/change
Decision Points
- whether the entry flow is public, invite-driven, or admin-assisted
- whether the deployment requires secure-channel encryption at the gateway
- whether MFA is email-based, OTP-based, or satisfied by backup code
- whether the account is fully active or blocked by pending approval
- whether the next route is onboarding, workspace selection, or security setup
Error Handling
Common auth failures usually come from transport context rather than business logic:
4010or auth-specific credential errors when the email, password, code, or session ID is invalid4000validation errors when encrypted bodies are malformed or contain unknown fields- rate-limit responses on login, MFA send, forgot-password, and password change/reset flows
- secure-channel failures when the public key, session ID, or encrypted body is stale
- portal mismatch issues when the request does not arrive through SYSTEM ingress
Implementation Notes
- treat pre-login session IDs as short-lived and single-purpose
- keep the same
X-Client-Hashacross initiate, MFA, and complete steps - do not decode the JWT for profile data; fetch
/web/v1/tenant/profileinstead - refresh expired access tokens through the refresh-token endpoint rather than replaying the login flow