Skip to content

Users, API keys and SSO

AUTH_TYPE decides how people sign in. Set it to the same value on the backend and the frontend.

AUTH_TYPE Sign-in Use it for
DB Username and password, stored by AVACOM Small teams; the default in docker-compose.prod.yml
OAUTH2PROXY Single sign-on through your identity provider (OIDC) Banks with Entra ID / Azure AD, Keycloak, Okta, Auth0 or Google
OKTA, ONELOGIN Direct Okta or OneLogin sign-in When you cannot run the SSO proxy
NOAUTH None: everyone is an administrator Isolated demos only; production refuses it

AUTH0, KEYCLOAK, AZUREAD and MULTI_TENANT are refused at start-up: use OAUTH2PROXY for those identity providers. Write the value in capitals (DB, not db), so the frontend and backend agree.

With AUTH_TYPE=DB, the backend creates one administrator the first time it starts:

  • username: AVACOM_DEFAULT_USERNAME (default avacom);
  • password: AVACOM_DEFAULT_PASSWORD if you set it (at least 12 characters). If you leave it unset, a random password is written to the file initial-admin-password in the backend’s state directory (/state in the containers), readable only by the service.

Read the generated password once, for example with docker compose exec avacom-backend cat /state/initial-admin-password, sign in, and change it with Change Password. AVACOM_FORCE_RESET_DEFAULT_PASSWORD=true resets it at the next start.

Open your name at the bottom of the menu, then Settings › Users. Add a user with their username, a password and Select a role: admin or noc (see Roles). A role change applies to the API at once, and to the menu at the user’s next sign-in.

Passwords need at least 12 characters (AVACOM_MIN_PASSWORD_LENGTH). Repeated failed sign-ins are throttled; see Signing in.

Tools that send alerts, and scripts that call the API, use API keys. Open Settings › Users and Access › API Keys, press Create API Key, give it a Name and a Role:

Role Give it to
webhook Anything that only sends alerts: MSN, monitoring tools, scripts
workflowrunner Schedulers that start workflows
noc Read-only integrations (dashboards, reports)
admin Automation that must change settings; use sparingly

Send the key in the X-API-KEY header. Keys can also be created at start-up with AVACOM_DEFAULT_API_KEYS=name:role:secret,...; put that value in your secrets file, not in a compose file.

Settings › Incoming Webhook shows the address alerts are posted to and ready-made curl, Python and Node examples. See Any tool, by webhook.

AVACOM signs users in through any OpenID Connect (OIDC) identity provider with oauth2-proxy in front of it. nginx asks oauth2-proxy to authenticate every request, then passes the user’s email and groups on. AVACOM maps the groups to roles.

browser ──▶ nginx ──auth_request──▶ oauth2-proxy ──▶ your identity provider
│
├─▶ / the app
├─▶ /v2/ the API
└─▶ /websocket/ live updates
Terminal window
cp .env.sso.example .env.sso # fill in the values below
python scripts/generate_secrets.py --missing-from .env.sso >> .env.sso
docker compose -f docker-compose-with-sso.yml --env-file .env.sso up -d --build

Open AVACOM_PUBLIC_URL. nginx listens on AVACOM_PORT (default 8000); put your TLS terminator in front of it.

Variable Meaning
AVACOM_PUBLIC_URL The address users open. Register <AVACOM_PUBLIC_URL>/oauth2/callback as the redirect URI at the identity provider.
OIDC_ISSUER_URL Your identity provider’s OIDC issuer (see below).
OIDC_CLIENT_ID, OIDC_CLIENT_SECRET The application registered at your identity provider.
OIDC_GROUPS_CLAIM The token claim that holds the user’s groups (default groups).
ADMIN_GROUPS, NOC_GROUPS, WEBHOOK_GROUPS Comma-separated group names or IDs for each role. When a user is in several, admin wins over NOC, and NOC over webhook. Users in none of them are refused (HTTP 403).
OAUTH2_PROXY_COOKIE_SECRET, NEXTAUTH_SECRET, AVACOM_PROXY_SHARED_SECRET Random secrets, generated by scripts/generate_secrets.py. nginx adds the last one to every request, so the API knows the request came through nginx.
COOKIE_SECURE, COOKIE_EXPIRE, COOKIE_REFRESH Cookies only over HTTPS (default true), how long a sign-in lasts (default 8h) and how often it is re-checked with the identity provider (default 1h).
ALLOWED_EMAIL_DOMAINS Only these email domains may sign in (default *, any).

Users are created on their first sign-in, and their role follows their groups: the API maps them again on every request.

Identity provider OIDC_ISSUER_URL Groups
Microsoft Entra ID (Azure AD) https://login.microsoftonline.com/<tenant-id>/v2.0 Add a groups claim (App registration › Token configuration). Entra sends group object IDs: put those IDs in ADMIN_GROUPS and the others.
Keycloak https://<keycloak-host>/realms/<realm> Add a Group Membership mapper with claim name groups to the client.
Okta https://<org>.okta.com/oauth2/default Add a groups claim to the authorization server.
Auth0 https://<tenant>.auth0.com/ Add groups or roles to the ID token with an Action, under a namespaced claim, and set OIDC_GROUPS_CLAIM to it.
Google Workspace https://accounts.google.com Google sends no groups in OIDC tokens: use OIDC_PROVIDER=google with oauth2-proxy’s Google group options.
  • Publish only nginx. The API trusts the identity headers nginx sets, so never expose the frontend, backend or realtime containers directly.
  • nginx drops any identity headers a client sends and sets them from oauth2-proxy’s answer, together with the shared secret. The API ignores identity headers on requests without that secret.
  • Monitoring tools post alerts to <AVACOM_PUBLIC_URL>/v2/alerts/event (or /v2/alerts/event/<provider>) with an API key. That path skips the SSO sign-in and accepts only API keys.
  • Serve AVACOM_PUBLIC_URL over HTTPS and leave COOKIE_SECURE=true.
  • The nginx configuration is oauth2proxy/nginx.conf.template.