A Auth API docs

Deploy & operate

Configuration

The API reads configuration from environment variables, with .env loaded on startup (existing environment variables win). Every value can be inspected and many can be overridden per application from the admin GUI.

Core

VariableDefaultPurpose
PORT8080HTTP listen port
ADMIN_API_KEY—Key for X-Admin-API-Key (/admin/*)
ADMIN_SESSION_EXPIRATION_HOURS8Admin GUI session lifetime
ADMIN_EMAIL—Recipient for system notifications (API key expiry)
ADMIN_URL—Base URL used in admin-facing links
FRONTEND_URLhttp://localhost:5173Default frontend used in emails
PUBLIC_URLhttp://localhost:8080Public base URL (OIDC issuer, links)

Database and Redis

VariableDefaultPurpose
DB_HOST / DB_PORT— / 5432PostgreSQL
DB_USER / DB_PASSWORD / DB_NAME—Credentials and database
REDIS_ADDR—host:port
REDIS_PASSWORD—Optional
REDIS_DB0Logical database
REDIS_NOTIFY_KEYSPACE_EVENTS—Set Ex for session-group expiry events

The API fails fast if PostgreSQL or Redis is unreachable: a broken dependency is not allowed to serve half-working authentication.

Tokens

VariableDefaultPurpose
JWT_SECRET—HMAC key; use at least 32 random characters
ACCESS_TOKEN_EXPIRATION_MINUTES15Access token lifetime
REFRESH_TOKEN_EXPIRATION_HOURS720Refresh token lifetime
OAUTH_STATE_SECRETJWT_SECRETHMAC key for OAuth state (≥ 32 bytes)
OAUTH_STATE_COOKIE_BINDINGtrueBind the state to the initiating browser
OAUTH_STATE_COOKIE_SAMESITEnonenone for cross-site frontends, lax/strict for same-site

Per-application overrides: access_token_ttl_minutes and refresh_token_ttl_hours (0 = use the global value).

Social providers

GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET / GOOGLE_REDIRECT_URL
FACEBOOK_CLIENT_ID / FACEBOOK_CLIENT_SECRET / FACEBOOK_REDIRECT_URL
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET / GITHUB_REDIRECT_URL

Credentials can also be stored per application in the GUI (Applications → OAuth), which is required for multi-tenant deployments.

OIDC provider

VariableDefaultPurpose
OIDC_ENABLEDfalseMaster switch for /oidc/*
OIDC_ID_TOKEN_EXPIRATION_MINUTES60ID token lifetime
OIDC_AUTH_CODE_EXPIRATION_MINUTES10Authorization code lifetime
OIDC_DEFAULT_APP_ID0000…0001Target of /.well-known/openid-configuration

WebAuthn

WEBAUTHN_RP_ID=localhost            # registrable domain, no scheme/port
WEBAUTHN_RP_NAME="Auth API"
WEBAUTHN_RP_ORIGINS=http://localhost:8080

RP_ID must match the domain users see in the browser; origins must list every frontend origin allowed to create passkeys. Wrong values produce SecurityError in the browser.

SMS

SMS_PROVIDER=twilio
SMS_TWILIO_ACCOUNT_SID=AC…
SMS_TWILIO_AUTH_TOKEN=…
SMS_TWILIO_FROM_NUMBER=+1555…

Without a provider SMS is disabled and SMS 2FA / SMS recovery are unavailable. The same credentials power both.

CORS and trusted-device cookies

VariableDefault
CORS_ALLOWED_ORIGINShttp://localhost:3000,http://localhost:5173,http://localhost:5174,http://localhost:5175,http://localhost:8080
CORS_ALLOWED_METHODSGET,POST,PUT,DELETE,OPTIONS,HEAD
CORS_ALLOWED_HEADERSOrigin,Content-Type,… (includes Authorization, X-App-ID)
CORS_ALLOW_CREDENTIALStrue
TRUSTED_DEVICE_COOKIE_SAMESITEnone (use lax for same-site deployments)

CORS is also editable from the GUI (Settings → CORS).

Session groups and GeoIP

VariableDefaultPurpose
SESSION_GROUP_EXPIRY_REVOCATION_ENABLEDtrueRevoke peer sessions on expiry
SESSION_GROUP_EXPIRY_SCAN_INTERVAL5mFallback scan interval
SESSION_GROUP_KEYSYSPACE_NOTIF_ENABLEDtrueListen to Redis expiry events
GEOIP_DB_PATH—MaxMind database for IP rules / anomaly detection

Precedence, again

environment  →  application (database)  →  built-in default

An environment variable always wins over the GUI. If a setting "does not stick", check the environment before filing a bug — the GUI shows the effective value in Settings → Info.