Overview
NeoSC supports both local authentication and Zitadel SSO integration for user management. The platform includes role-based access control (RBAC) with two primary roles: admin and user.User Registration
Local Registration
Users can register directly on the platform using email and password.Create a user account
Send a POST request to The system automatically assigns the
/api/auth/register with user details:user role and enables MFA by default.SSO Registration with Zitadel
NeoSC integrates with Zitadel OIDC for enterprise single sign-on.Zitadel SSO uses the PKCE flow for enhanced security. Two Zitadel instances are supported:
- On-premise:
https://manager.kappa4.com(default) - Cloud:
https://beyondcloud-nxm7ab.us1.zitadel.cloud
Token exchange
The backend handles token exchange via See
/api/auth/token-exchange:backend/server.py:335-436 for implementation details.User Roles
Role Types
NeoSC implements two primary roles stored in theUser.role field:
| Role | Capabilities |
|---|---|
| user | Launch workspaces, manage own sessions, view personal audit logs |
| admin | All user capabilities + manage workspaces, view all audit logs, toggle policies, manage organization settings |
Role Assignment via SSO
When using Zitadel SSO, roles are automatically assigned based on claims:Role-Based Endpoint Protection
Admin-only endpoints enforce role checks:POST /api/workspaces- Create workspacePUT /api/workspaces/{id}- Update workspace configurationDELETE /api/workspaces/{id}- Delete workspacePOST /api/workspaces/reset- Reset to defaults
Organization Management
Organization Model
Organizations group users and workspaces for multi-tenant support:Default Organization
New users are assigned to their specified organization or “Default Organization”:Viewing Organizations
Retrieve all organizations viaGET /api/organizations. The endpoint returns organization details with user and workspace counts.
Organization creation and management endpoints are planned for future releases (P2 priority in roadmap).
User Authentication
Local Login
Authenticate with email and password:backend/server.py:126-127).
Token Management
The backend uses bearer tokens stored in-memory:Logout
Revoke tokens viaPOST /api/auth/logout. This removes the token from the active tokens store and logs the event.
User Profile Management
Retrieve Current User
Get authenticated user details:MFA Settings
MFA is enabled by default for all users (mfa_enabled: true). The system enforces MFA policies as defined in security policies.
WebAuthn/FIDO2 registration is planned for P1 priority implementation. Currently, MFA status is tracked but full MFA flow requires integration.
Audit Logging
All user actions are automatically logged:register- User registrationlogin- Local authenticationsso_login- SSO authentication with provider and rolelogout- Session terminationlaunch_workspace- Workspace launchstop_workspace- Workspace stopdisconnect_session- Session disconnect
GET /api/audit-logs:
- Admins: See all user activity
- Users: See only their own activity
Best Practices
Use SSO for Enterprise
Leverage Zitadel SSO for centralized authentication and role management instead of managing local credentials.
Assign Roles Carefully
Grant admin role only to trusted users. Admins have full workspace and policy management capabilities.
Monitor Audit Logs
Regularly review audit logs to detect unauthorized access attempts and unusual activity patterns.
Enable MFA
Ensure MFA is enabled for all users, especially administrators with elevated privileges.
Troubleshooting
SSO Login Fails
If token exchange fails, check:- Zitadel authority URL is accessible from backend
- Client ID and redirect URI match Zitadel configuration
- PKCE code verifier matches the challenge
- Backend logs for detailed error messages (
backend/server.py:365-371)
Role Not Assigned Correctly
Verify Zitadel role claims:- Check project ID matches:
ZITADEL_PROJECT_ID - Ensure roles are granted in Zitadel project
- Inspect ID token claims for
urn:zitadel:iam:org:project:{PROJECT_ID}:roles
User Cannot Access Admin Endpoints
Confirm:- User role is set to
adminin database - Token is valid and contains correct user object
- Endpoint checks
user.get('role') == 'admin'