Authentication Setup¶
This page covers how administrators configure the sign-in options for the VirtualSutra AI console via environment variables. End users sign in via the method their administrator has set up; see Authentication for the user-facing guide.
Note: There is also a self-service Settings > Identity > SSO Provider page (see SSO Configuration) for preparing and validating an OIDC configuration, but it doesn't yet enable sign-in on its own; the environment variables below are still required.
How auth mode is selected¶
The console automatically selects the auth mode based on environment variables set on the ui container:
| Condition | Mode |
|---|---|
One or more AUTH_*_ID vars set | OAuth2 / OIDC (recommended), plus a link to the built-in admin account |
| None set | The built-in admin account's username and password form |
AUTH_DEV_MODE=true and no AUTH_*_ID | Dev passthrough - no auth at all (local dev only, never for production) |
The built-in admin account exists beside OAuth on every self-hosted deployment (not on SaaS).
OAuth / Single Sign-On¶
Required environment variables (all modes)¶
| Variable | Description |
|---|---|
AUTH_SECRET | JWT encryption secret - required. Generate with: openssl rand -base64 32 |
AUTH_URL | Public URL of the console (e.g. https://vsutra.yourcompany.com). Required for OAuth redirect URIs in production. |
Google Workspace¶
- Go to console.cloud.google.com → APIs & Services → Credentials
- Create an OAuth 2.0 Client ID (type: Web application)
- Add Authorized redirect URI:
https://vsutra.yourcompany.com/api/auth/callback/google - Set env vars on the
uiservice:
GitHub¶
- Go to GitHub → Settings → Developer settings → OAuth Apps → New OAuth App
- Set Authorization callback URL:
https://vsutra.yourcompany.com/api/auth/callback/github - Set env vars on the
uiservice:
Microsoft 365 / Entra ID¶
- In Azure Portal → Microsoft Entra ID → App registrations → New registration
- Add redirect URI:
https://vsutra.yourcompany.com/api/auth/callback/microsoft-entra-id - Create a client secret under Certificates & secrets
- Set env vars on the
uiservice:
AUTH_MICROSOFT_ENTRA_ID=<application-client-id>
AUTH_MICROSOFT_ENTRA_SECRET=<client-secret-value>
AUTH_MICROSOFT_ENTRA_TENANT_ID=<directory-tenant-id>
Generic OIDC - Okta, Auth0, Keycloak, etc¶
- Register a new application in your IdP
- Set the callback URL to:
https://vsutra.yourcompany.com/api/auth/callback/oidc - Set env vars on the
uiservice:
AUTH_OIDC_ISSUER=https://your-tenant.okta.com
AUTH_OIDC_CLIENT_ID=<client-id>
AUTH_OIDC_CLIENT_SECRET=<client-secret>
AUTH_OIDC_NAME=Okta # Label shown on the sign-in button
Assigning admin role¶
By default all authenticated users get the operator role. Grant admin by listing email addresses:
This assigns the admin role to that user's console session at sign-in. It is not itself the server-side gate: the API resolves your role from your user record through the signed actor assertion the console mints, and require_admin_actor() checks that resolved role. Changing this list takes effect at the user's next sign-in.
An operator already holds read, write, schedule:write, findings:write, remediation:approve, schedule:read and reports:read - so cancelling a run and deleting a schedule are not admin-only. What admin adds is tenant configuration and identity management: Settings > Admin (Users, Organizations, API Keys, Service Accounts), SSO configuration, custom frameworks/checks/policies, compliance parameters, LLM Configuration (BYOM), notification channels and billing. A viewer holds read alone.
See the Tier & Scope Matrix for the full per-area breakdown.
The built-in admin account¶
Every self-hosted deployment has one local account, admin, created by the API with an initial password (provided by VirtualSutra support on request) that must be changed at the first sign-in - see Authentication. Nothing configures it on the ui container; it needs only SESSION_SECRET, which signs its session cookie:
Verification¶
After configuring, restart the ui container and navigate to your console URL. You should see the provider button(s) on the sign-in page.
To verify the correct provider is shown:
| What you configured | What users see |
|---|---|
AUTH_GOOGLE_ID | Sign in with Google button |
AUTH_GITHUB_ID | Sign in with GitHub button |
AUTH_MICROSOFT_ENTRA_* | Sign in with Microsoft button |
AUTH_OIDC_* | Button labelled with your AUTH_OIDC_NAME value |
No AUTH_*_ID | The built-in admin account's username and password form |
Related
- Authentication - end-user sign-in guide
- SSO Configuration: self-service OIDC provider registry (Settings)