Portal Overview

Portal Route Who Uses It Primary Tasks Key Features
Customer Portal /portal End customers, applicants, external parties Submit new requests, track case status, upload documents, sign documents electronically, communicate with agents Case submission wizard, real-time tracker, document upload with drag-and-drop, DocuSign e-sign iframe, secure messaging thread, magic link login support
Agent Portal /agent Front-line case workers, reviewers, processors Claim and process cases, complete workflow steps, submit forms, add notes, communicate with customers, escalate issues Work queue with SLA indicators, 3-panel case detail view (Timeline / Active Step / Case Info), step completion forms, note-taking, case linking, bulk claim
Manager Portal /manager Team leads, supervisors, operations managers Monitor team performance, handle escalations, reassign work, view analytics, configure team settings Team dashboard (queue health, SLA breach alerts), HxStream live feed, HxAnalytics BI queries, bulk reassignment, access group management, audit log viewer
Studio /studio (:5173 in dev) Administrators, developers, architects Design case types and workflows, configure connectors, manage users and access groups, govern deployments NLP Builder, Case Type Editor, Stage/Step designer, Form Builder, Connector Library, HxGraph Studio, HxDeploy, User Management, Audit Logs, HxBranch versioning

Authentication Methods

Method How It Works Portals Supported Configuration
Username / Password Standard credential login. Password compared against bcrypt hash. Issues JWT access token (15m) + refresh token (7d httpOnly cookie). All four portals Always enabled. Users created in Studio > Users or via POST /api/v1/users.
SSO — SAML2 SP-initiated flow. Velaris redirects to IdP for authentication. On callback, assertion is parsed, user is looked up or auto-provisioned, JWT is issued. Agent Portal, Manager Portal, Studio Configured as a saml provider under Admin Console → SSO. Import the IdP's metadata, or enter the issuer, sign-in URL and certificate by hand.
SSO — OIDC Authorization Code Flow with PKCE. Velaris receives ID token from provider. Claims mapped to Velaris user attributes. JWT issued on successful validation. Agent Portal, Manager Portal, Studio Configured as a provider row with its client id, secret and endpoints. The client secret is encrypted at rest and never returned by any endpoint.
Magic Link Customer enters email. Velaris sends a time-limited signed link (15 minutes). Clicking the link exchanges the one-time token for a JWT session. No password required. Customer Portal only Requires MAGIC_LINK_ENABLED=true and SMTP configuration (SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS).
MFA — TOTP Time-based one-time password as a second factor. After password verification, user is prompted for a 6-digit TOTP code from their authenticator app. Enrollment generates a QR code and backup codes. Each TOTP code is single-use and valid for 30 seconds. Agent Portal, Manager Portal, Studio Users enrol via Studio > Profile > Security > Enable MFA. Admins can require MFA per access group. Uses pyotp (RFC 6238) on the backend.
Forgot Password (OTP) User requests a password reset. Velaris sends a single-use OTP to their registered email (valid 10 minutes). OTP is exchanged for a password-reset token; user sets a new password. Brute-force protected — locked after 5 invalid attempts. All portals Requires SMTP configuration. Endpoint: POST /api/v1/auth/real/forgot-password.

SSO Configuration Walkthrough

There are no SSO environment variables. Earlier versions of this page described SSO_ENABLED, SSO_PROVIDER, SSO_METADATA_URL and friends, along with an /api/v1/auth/sso/init endpoint. None of them exist. SSO is configured entirely in Studio → Admin Console → SSO, stored in the sso_providers table, and takes effect on save — no file to edit, no restart.
  1. Register the application at your identity provider and copy its details — for SAML, its federation metadata URL is enough.

  2. In Studio, open Admin Console → SSO → + New Provider. Choose google or github (built in), saml, or type any other OIDC provider's name and supply its endpoints.

  3. For SAML, paste the metadata URL into Import from IdP metadata and press Import — the issuer, sign-in URL and certificate fill themselves in. For OIDC, enter the client id and secret.

  4. List the allowed email domains if new users should be created on first sign-in. Leaving it empty means existing accounts only.

  5. Save. The button appears on the sign-in page immediately; disabling the row removes it just as quickly.

SAML has a page of its own, with Okta and Entra ID walkthroughs and the field-name translation between them: SAML SSO Setup. The endpoints and their privileges are in Auth API.

JWT Token & Session

Token TTL Storage Used For
Access Token Configurable (TOKEN_EXPIRE_DAYS) localStorage under key velaris_token Authorization: Bearer header on every API call. Expiry detected client-side by AuthContext.tsx — expired sessions trigger automatic logout.

Signing Algorithm

Velaris supports two JWT signing modes, controlled by environment variables:

ModeAlgorithmWhen UsedConfig
HS256 (symmetric)HMAC-SHA256Default / development. All services share the same secret.AUTH_SECRET env var
RS256 (asymmetric)RSA-SHA256Recommended for production. Private key mints tokens; other services verify with public key only.Set VELARIS_CASE_AUTH_RSA_PRIVATE_KEY + VELARIS_CASE_AUTH_RSA_PUBLIC_KEY. RS256 activates automatically when these are present.
OIDCRS256 (external)Tokens issued by Keycloak / Auth0 / any OIDC-compliant IdP. Velaris validates using the IdP's public key.AUTH_OIDC_ISSUER + AUTH_OIDC_AUDIENCE
Production recommendation: Always use RS256 or OIDC mode. HS256 means every service that verifies a token also holds the signing secret and could mint admin tokens. RS256 eliminates that risk — the private key lives in the auth service only.

Account Security

FeatureDetail
Password hashingbcrypt (12 rounds)
Account lockout5 failed attempts locks the account for 15 minutes. Lockout is logged as an audit event.
MFA (TOTP)RFC 6238 time-based OTP via authenticator app. Enrollment generates a QR code and single-use backup codes. Required per-user or enforced per access group.
Forgot passwordEmail OTP flow — 6-digit code valid for 10 minutes. OTP is single-use and brute-force protected.
SSO providersGoogle and GitHub are built in — their endpoints are known, and a preset name cannot be repointed by editing config. Any other OIDC provider (Okta, Entra ID, Keycloak, Auth0) works by naming it and supplying its endpoints; SAML 2.0 works through the saml provider.

Session Management

Velaris maintains a unified session across all four portals. Once authenticated, users can switch between portal routes (/portal, /agent, /manager, /studio) without re-authenticating, as long as their role permits access to the target portal.

Security Roadmap

The following security enhancements are planned as part of the platform's hardening roadmap (see Architecture Improvement Report §3):

FeatureDescriptionPriority
FIDO2 / PasskeysWebAuthn-based phishing-resistant login for operators and admins. Step-up re-prompt for sensitive actions (HxDeploy promotes, GDPR erasure, HxGlobal sovereignty changes).High
Short-lived tokens + refresh rotation5–15 minute access tokens with rotating refresh tokens stored in httpOnly cookies. Valkey-backed revocation list using jti for immediate session kill.High
ReBAC authorization (HxGuard)Relationship-based access control (OpenFGA / SpiceDB) replacing flat RBAC. Handles case assignment, tenant membership, cross-region access, and delegation in a single policy decision point.Medium
Device trustDevice fingerprint bound to refresh tokens. Re-challenge on device or geo change. Anomaly signals fed into HxShield.Medium
mTLS between servicesSPIFFE/SPIRE workload identity + Linkerd mTLS for all inter-service communication. Eliminates the implicit trust between services that share an HS256 secret.Medium

Role-Portal Access Matrix

Role Customer Portal Agent Portal Manager Portal Studio
Admin ✓ Full ✓ Full ✓ Full ✓ Full
Developer ✓ Full ✓ Full ✓ Read-only ✓ Full (no user mgmt)
Manager — ✓ Full ✓ Full —
Agent — ✓ Full — —
Customer ✓ Own cases only — — —
Auditor — ✓ Read-only ✓ Read-only ✓ Audit Logs only
Access group scoping: The role-portal matrix defines what portal a user can enter. Access groups then further restrict which cases within that portal the user can see and act on. An Agent with the Worker permission in access group "Mortgage Team" can only see and claim cases belonging to that group.