Security & Trust
Authentication
JWT authentication, invite codes, and planned SSO/MFA implementations.
Authentication
Steadybase uses JWT-based authentication with invite codes for user onboarding. This page covers the current implementation and planned enhancements.
Current Implementation
Invite Code Authentication
New users authenticate using invite codes — randomized, role-specific codes:
| Role | Format | Access Level |
|---|---|---|
| Admin | SB-ADMIN-XXXXXXXX | Full read/write access to all endpoints |
| Viewer | SB-VIEW-XXXXXXXX | Read-only access to dashboards and data |
Invite codes are:
- Randomized (no default or guessable codes)
- Role-scoped (each code maps to a specific role)
- Server-side validated
JWT Tokens
After successful invite code validation, the server issues a JWT token:
- Expiration: 24 hours
- Storage: httpOnly cookie (primary), localStorage (fallback)
- Validation: Checked on every
/api/*request via auth middleware
Auth Middleware
All API routes pass through auth middleware that:
- Extracts the JWT from the cookie or Authorization header
- Validates the signature and expiration
- Attaches the user context to the request
- Enforces role-based access for protected operations
WebSocket Authentication
WebSocket connections require a valid JWT:
Unauthenticated WebSocket connections are rejected.
Known Limitations
:::warning These limitations are documented transparently and are being addressed. :::
| Limitation | Risk | Mitigation Plan |
|---|---|---|
| localStorage fallback | XSS can steal tokens | Remove fallback, use httpOnly cookies exclusively |
| No CSRF protection | Cross-site request forgery | Add CSRF token validation |
| No MFA | Single factor only | Planned in Phase 3 (TOTP/WebAuthn) |
| No SSO | No enterprise identity provider integration | Planned in Phase 3 (SAML/OIDC) |
| No session revocation | Can't invalidate active tokens | Add token blacklist or short-lived tokens + refresh |
Planned Enhancements
Phase 2: Hardened Auth
- Remove localStorage token storage
- Implement CSRF protection
- Add token refresh mechanism
- Implement session revocation
Phase 3: Enterprise Auth
- SSO — SAML 2.0 and OIDC support for enterprise identity providers
- MFA — TOTP (Google Authenticator) and WebAuthn (hardware keys)
- EdDSA Signing — Upgrade JWT signing from HMAC to EdDSA (Ed25519)
- AWS Cognito — Full integration with AWS Cognito for user management
Rate Limiting
Auth endpoints have stricter rate limits than general API endpoints:
| Endpoint Type | Limit | Window |
|---|---|---|
Auth (/auth/*) | 10 requests | 15 minutes |
General (/api/*) | 300 requests | 15 minutes |
This prevents brute-force attacks on invite codes and login endpoints.