Skip to content

Configuration

Every setting is read from the environment or a .env file, prefixed IDEN_. Defaults are development defaults — the ones that matter in production are called out below the table.

Where settings live

There are several .env files in the repository, which looks like more configuration than it is. Each belongs to one process, and only one of them is ever in play at a time:

File Read by In play when
deploy/.env Docker Compose, substituting ${VAR} into docker-compose.yml any docker compose run
provider/.env the provider process itself uv run provider or uv run pytest on the host
web/auth-ui/.env, web/dashboard/.env Vite pnpm dev

They hold overlapping keys but cannot hold the same values: provider/.env points the database at localhost:5432, and inside a container that address is the container itself. Each has an .env.example beside it to copy.

Every setting in the table below can be set from deploy/.env, whether or not it appears in deploy/.env.example — docker-compose.yml names them all with their defaults. The one exception is IDEN_BOOTSTRAP_ADMIN_PASSWORD, deliberately: a value there would sit in the container's environment for as long as the container lives, where docker inspect reads it.

environment: in docker-compose.yml is not another place to configure things

That block holds two kinds of value, and only one is yours:

  • ${VAR:-default} — a deployment setting. It comes from deploy/.env, and the default is a laptop. This is the group you edit, and deploy/.env is where.
  • A plain value — wiring. postgres:5432, /keys, seaweedfs:8333 are the service names and mount points defined by that same file. There is nothing to configure; change one and it stops resolving.

Editing docker-compose.yml to set a hostname works, but it is a tracked file, so every upgrade then conflicts with your deployment. That is what deploy/.env exists to avoid.

The provider

Variable Default Notes
IDEN_ENV dev prod makes the session cookie Secure, sends HSTS, and withholds /docs, /redoc and /openapi.json. The provider refuses to start in prod with an http:// issuer or Auth UI, a database or Redis URL without a password of its own, a published S3 secret, or IDEN_FORWARDED_ALLOW_IPS=* — and in dev with an https:// issuer, which is a real deployment misconfigured.
IDEN_LOG_LEVEL info
IDEN_API_PREFIX empty Mount the whole app under a sub-path. Must stay empty otherwise — OIDC requires /.well-known/* at the host root.
IDEN_ALLOWED_ADMIN_ORIGINS [] Browser origins allowed to send credentialed requests, beyond the Auth UI. Empty is correct when everything is on one origin: same-origin calls are not cross-origin and there is nothing to permit.
IDEN_FORWARDED_ALLOW_IPS empty Addresses whose X-Forwarded-For is believed, comma-separated; CIDRs accepted. Empty trusts nobody, which is right with nothing in front. Behind a proxy, name the proxy's network — see below. Never *.
IDEN_WORKERS 2 Server processes when IDEN_ENV=prod; development always runs one, with reload. Each is its own event loop, so a slow request holds up only its worker's share. Budget roughly 300 MiB each.
IDEN_ISSUER http://localhost:8000 The identity of this deployment. It appears in every token, and clients validate against it. Changing it invalidates everything already issued.
IDEN_AUTH_UI_BASE_URL http://localhost:4000 The origin the Auth UI is served from; /auth/login, /auth/consent and /auth/reset are appended to it. On a single-origin deployment this is the same value as IDEN_ISSUER.
IDEN_ORG_NAME empty Whose deployment this is. The same variable the two frontends read — set it on all three. Here it names the TOTP credential an authenticator app files, so it is what someone sees beside their code. Empty means IDEN.
IDEN_MAIL_DOMAIN localhost The organization's mail domain. Every account created through POST /admin/users is <local part>@<this>, lowercased, and marked verified — an administrator chooses only the part before the @, and it cannot be changed afterwards. Set it before the first user is added; changing it later leaves existing accounts where they are. The dashboard reads the same variable.
IDEN_DATABASE_URL postgresql+asyncpg://iden:iden@localhost:5432/iden
IDEN_REDIS_URL redis://localhost:6379/0 Sessions, pending sign-ins, the denylist, and rate-limit counters.
IDEN_S3_ENDPOINT_URL empty Blob storage, over the S3 API. Empty means none is attached and profile photos and application logos are unavailable; nothing else changes.
IDEN_S3_ACCESS_KEY empty
IDEN_S3_SECRET_KEY empty
IDEN_S3_BUCKET iden Created at startup when it does not exist.
IDEN_S3_REGION us-east-1 Required by the S3 signature even where the store ignores it.
IDEN_AVATAR_MAX_BYTES 5242880 (5 MiB) Refused before the upload is decoded.
IDEN_SIGNING_KEY_DIR keys One PEM per key. Filenames sort, and the last one signs — a date-stamped name makes the newest key active.
IDEN_SIGNING_ALGORITHM RS256
IDEN_TOTP_KEY_FILE <IDEN_SIGNING_KEY_DIR>/totp.key The key that encrypts TOTP secrets at rest. Generated by scripts.gen_keys alongside the signing key. Losing it locks every enrolled account out of its second factor — back it up with the signing keys.
IDEN_ACCESS_TOKEN_TTL 600 (10 min) Short on purpose: permission changes take effect at the next issuance, and a revoked token cannot be recalled before it expires.
IDEN_ID_TOKEN_TTL 600 (10 min)
IDEN_REFRESH_TOKEN_TTL 2592000 (30 days) Sliding; rotated on every use.
IDEN_AUTH_CODE_TTL 60 (1 min) Single use.
IDEN_SESSION_TTL 86400 (24 hours) Sliding browser session: ends after this long unused.
IDEN_SESSION_MAX_AGE 604800 (7 days) Ends a browser session this long after sign-in, however recently it was used, so a stolen cookie or a shared computer left signed in does not stay signed in forever. Signing in again restarts it; a step-up does not. Refresh tokens are separate and follow IDEN_REFRESH_TOKEN_TTL.
IDEN_CHALLENGE_TTL 600 (10 min) How long a pending sign-in or consent page stays valid.
IDEN_REFRESH_GRACE_PERIOD 30 (seconds) How long a spent refresh token keeps returning what it was exchanged for. 0 restores strict single use, at the price of signing people out over a double-click.
IDEN_RATE_LIMIT_ENABLED true Off only for a load test against a deployment you own — see Measuring performance.
IDEN_DEVELOPER_MAX_CLIENTS 5 How many applications one account may register through /developer/clients. A cap on the table, not a policy — an administrator can register more on someone's behalf.
IDEN_BOOTSTRAP_ADMIN_EMAIL admin@localhost The first administrator's address. Read only when the seed creates the account; changing it later seeds a second administrator rather than renaming the first.
IDEN_BOOTSTRAP_ADMIN_PASSWORD empty Left empty, the seed generates one and prints it once. deploy/docker-compose.yml deliberately does not carry it — a password there would outlive its one use, in an environment docker inspect reads. Pass it to the seed command itself if you want to choose it. Ignored once the account exists.
IDEN_BIOMETRIC_ENABLED false Faces as a second factor, enrolled at a kiosk. Off, /biometric/*, /admin/kiosks* and /entity/face* answer 404 and are absent from /docs, and face sign-in answers 501. Re-run the seed after turning it on. See Faces.
IDEN_ENGINE_BASE_URL http://engine:8000 Where the biometric engine listens. The default is the engine on the provider's host; for one on another machine, its address there, such as http://10.0.0.5:8000.
IDEN_ENGINE_TOKEN_FILE <IDEN_SIGNING_KEY_DIR>/engine.token The secret the provider presents to the engine. Written by scripts.gen_keys; losing it costs nothing — write a new one and restart both.
IDEN_ENGINE_TIMEOUT 20 (seconds) How long to wait for the engine to judge a capture.
IDEN_BIOMETRIC_KEEP_IMAGES false Keep enrolment photos, encrypted, in blob storage, so a model upgrade can re-embed them with scripts.reembed_faces. Off, only embeddings are stored and people enrol again after an upgrade. Needs blob storage; refused in prod without it.
IDEN_FACE_TICKET_TTL 900 (15 min) How long the QR code that lets a kiosk enrol someone's face stays usable.
IDEN_FACE_ENROL_ATTEMPTS 5 Capture attempts one enrolment QR code allows; after the last, the person asks the dashboard for a new one.
IDEN_FACE_LOGIN_ATTEMPTS 3 Faces that fail to match one account within IDEN_FACE_LOGIN_WINDOW before face sign-in pauses for it. A poor capture does not count; a successful sign-in resets the count. Not enforced when IDEN_RATE_LIMIT_ENABLED is off.
IDEN_FACE_LOGIN_WINDOW 900 (15 min) The window those failures are counted over, which is also how long face sign-in stays paused.
IDEN_KIOSK_PAIRING_TTL 900 (15 min) How long the code that pairs a new kiosk device stays usable.

Docker Compose only

Read by Docker Compose from deploy/.env, not by the provider. They configure the containers around it.

Variable Default Notes
IDEN_UID, IDEN_GID 1000 The user and group the provider and the engine run as. provider/keys is readable only by the user that generated it, so set these to that user's id -u and id -g. The install pages write them for you — see step 3 of the laptop install.
IDEN_POSTGRES_PASSWORD iden PostgreSQL's password, also written into the provider's database URL. Set it before the first up: the volume keeps the one it was created with.
IDEN_REDIS_PASSWORD iden Redis's password, also written into the provider's Redis URL.
IDEN_S3_ACCESS_KEY, IDEN_S3_SECRET_KEY iden, idensecret SeaweedFS's credentials, passed to the provider as its S3 credentials.
IDEN_ENGINE_WORKERS 1 Passed to the engine as ENGINE_WORKERS.
CLOUDFLARE_TUNNEL_TOKEN none The tunnel overlay only. See Behind a Cloudflare Tunnel.

The engine's own Compose files in engine/deploy/ read engine/deploy/.env the same way: ENGINE_UID and ENGINE_GID (as above, for engine.token), ENGINE_PUBLISH (the address and port it listens on, 127.0.0.1:8000 by default), ENGINE_ENV and ENGINE_WORKERS.

The biometric engine

Read by the engine service, not the provider. Every engine compose file sets the token, the model directory, ENGINE_ENV and ENGINE_WORKERS — on the provider's host from IDEN_ENV and IDEN_ENGINE_WORKERS in deploy/.env. Each image sets ENGINE_DEVICE for its build, and the GPU files set it to cuda.

Variable Default Notes
ENGINE_TOKEN_FILE empty The same engine.token the provider presents. Required when ENGINE_ENV=prod.
ENGINE_MODEL_DIR models Where scripts.fetch_models put the model files.
ENGINE_DEVICE auto auto uses an NVIDIA GPU when one is visible; cuda refuses to start without one; cpu never uses it.
ENGINE_WORKERS 1 Captures checked at once. Each holds its own copy of the models in memory.
ENGINE_MAX_INFLIGHT 2 Captures computed at once within one worker. Each inference already uses every core, so more only slows them all.
ENGINE_QUEUE_SECONDS 10 How long a capture waits for a slot before the engine answers 503 with Retry-After. Keep it under IDEN_ENGINE_TIMEOUT.
ENGINE_MANIFEST models.toml The models, their checksums, and the thresholds calibrated for them.
ENGINE_ENV dev prod hides /docs and requires the token.
ENGINE_LOG_LEVEL info
ENGINE_MAX_FRAMES 16 Frames accepted in one capture. An enrolment is 9 and a sign-in 3; this is the ceiling.
ENGINE_MAX_FRAME_BYTES 400000 Size of one encoded frame. Frames are JPEG; anything else is refused.
ENGINE_MAX_PIXELS 4000000 Decoded pixels in one frame — a small file can declare a huge canvas.

The kiosk server

Read by the kiosk server on each kiosk, not the provider. install.sh writes /opt/iden-kiosk/.env with KIOSK_ISSUER, and two values for the device itself rather than the server — KIOSK_IMAGE, the image to run, and KIOSK_USER, the desktop user kiosk mode runs as. Run install.sh again to change any of them. The image sets the rest. See Kiosks.

Variable Default Notes
KIOSK_ISSUER http://localhost:8000 IDEN's public address — where the device pairs and sends captures. With KIOSK_ENV=prod (as in the image) it must be https://, or a loopback or private-network address.
KIOSK_DATA_DIR data Holds credentials.json, the kiosk's client secret. A volume in Docker, so it survives an update.
KIOSK_UI_DIR empty The built kiosk app. Empty in development, where Vite serves it.
KIOSK_TIMEOUT 30 (seconds) How long to wait for IDEN. Above IDEN_ENGINE_TIMEOUT, so the provider's answer arrives first.
KIOSK_ENV dev prod in the image: logs as JSON.
KIOSK_LOG_LEVEL info
KIOSK_VERSION dev Reported to the dashboard. The image takes it from the VERSION build argument.

The two frontends

auth-ui and dashboard are static builds, so their configuration is read at container start rather than compiled in — one image serves any deployment. The entrypoint writes these into /config.js.

Variable Default Notes
IDEN_ISSUER http://localhost:8000 The provider's origin, which is what these apps call. If it differs from the origin the app itself is served from, that serving origin is the one that has to appear in IDEN_ALLOWED_ADMIN_ORIGINS — CORS permits the caller, not the callee.
IDEN_ORG_NAME empty Whose sign-in page this is. Takes the larger type wherever both appear, with IDEN as a caption beneath. Empty and IDEN stands alone. The provider reads the same variable — give all three services the same value.
IDEN_ORG_LOGO_URL empty Any URL the browser can reach. Sits beside the name.
IDEN_MAIL_DOMAIN localhost Dashboard only. Shown beside the email field when adding a user. The provider decides the address, so give both the same value.

Under pnpm dev there is no container, so the same settings are read from Vite environment variables with a VITE_ prefix: VITE_IDEN_ISSUER, VITE_IDEN_ORG_NAME, VITE_IDEN_ORG_LOGO (no _URL, unlike IDEN_ORG_LOGO_URL above), and the dashboard's VITE_IDEN_MAIL_DOMAIN. Each app has an .env.example to copy.

The ones that matter in production

IDEN_ISSUER is the identity of the deployment. It goes into every token and every client validates against it. Set it to the public HTTPS URL, and treat changing it as invalidating every token in circulation.

IDEN_SIGNING_KEY_DIR holds the private keys that sign every token. Anyone who reads them can mint a token for anyone. Mount it read-only, keep it off the image, and back it up somewhere you would be comfortable keeping a password.

IDEN_TOTP_KEY_FILE encrypts the one credential IDEN cannot hash. Verifying a time-based code means recomputing it, so the secret has to be readable — and without this a database dump would be a working second factor for every enrolled account, while the passwords beside it are argon2. The key lives in the signing key directory by default, which is already mounted read-only, kept out of the image and backed up. Replace it and every enrolled authenticator stops verifying, and those people cannot sign in until an administrator clears their enrolment.

IDEN_ENV=prod makes the session cookie Secure, so it is never sent over plain HTTP. It also withholds the interactive docs, which are the complete shape of the admin API.

IDEN_FORWARDED_ALLOW_IPS decides who the caller is. IDEN reads the address from the socket unless the peer is named here, in which case it takes the address that peer states in X-Forwarded-For. Both the per-address rate limits and the ip column of the audit log rest on the answer.

Empty behind a proxy makes every per-address limit a deployment-wide one — TOKEN_PER_IP stops being 120 requests a minute per caller and becomes 120 a minute in total — and writes the proxy's address into every audit row. * accepts the header from anyone, which makes both forgeable. Name the proxy's network, and no more of it than necessary.

Rotating a signing key

Keys sort by filename and the last one signs, so a date-stamped name makes the newest key active:

keys/
  iden-20260101.pem     ← was signing
  iden-20260801.pem     ← now signing

To make the new key, run scripts.gen_keys again, the same command as at install (for Docker, the docker run in step 2 of the laptop install). It names the key after today's date and leaves every existing file alone, so it writes a new key only on a day that has none yet. Then restart the provider, which reads the keys only at start-up:

docker compose -f deploy/docker-compose.yml restart provider

Keep the old key in place until every token signed with it has expired — it is still published in JWKS, so tokens already issued keep validating. Then delete it. The warning in Deployment explains the five minutes to wait.