Basic Authentication
The basic authentication module lets you protect WUD access using the HTTP Basic authentication standard.
Configuring users via static environment variables (WUD_AUTH_BASIC_{auth_name}_*) is deprecated and will be removed in a future release.
- To bootstrap your administrator account: Use
WUD_AUTH_ADMIN_USERandWUD_AUTH_ADMIN_PASSWORD. - To manage local users: Manage users and their roles (
admin,rw,ro) directly in the Web UI under Configuration > Users. - For external scripts and CI/CD automation: Use Personal API Tokens (
Authorization: Bearer wud_...) generated from My Profile instead of sharing static credentials. - For Single Sign-On: Use OpenID Connect (OIDC).
Variables
Password for the bootstrap administrator account. Automatically hashed using bcrypt when seeded into the database.
Username for the bootstrap administrator account created on initial startup.
Legacy variable: htpasswd-compliant password hash (see htpasswd documentation).
Legacy variable: username for an authorized user seeded at startup.
User accounts and their hashed passwords are now persisted directly in the WUD database. Environment variables are used to automatically seed or update administrator access upon startup. You can also create and manage subsequent users directly through the WUD Web UI.
$ characters; make sure to escape or quote them appropriately:- Use double
$$in Docker Compose files (see variable substitution):WUD_AUTH_BASIC_JOHN_HASH: $$apr1$$aefKbZEa$$ZSA5Y3zv9vDQOxr283NGx/ - Use single quotes in shell commands:
WUD_AUTH_BASIC_JOHN_HASH='$apr1$aefKbZEa$ZSA5Y3zv9vDQOxr283NGx/' - Or escape
\$with backslashes in double-quoted strings:WUD_AUTH_BASIC_JOHN_HASH="\$apr1\$aefKbZEa\$ZSA5Y3zv9vDQOxr283NGx/"
:) are not supported due to a limitation in the underlying passport-http library. Authentication will fail if your password contains a colon. Use passwords without colons until this is resolved.Examples
- Docker Compose
- Docker
services:
whatsupdocker:
image: getwud/wud
...
environment:
- WUD_AUTH_BASIC_JOHN_USER=john
- WUD_AUTH_BASIC_JOHN_HASH=$$apr1$$8zDVtSAY$$62WBh9DspNbUKMZXYRsjS/
- WUD_AUTH_BASIC_JANE_USER=jane
- WUD_AUTH_BASIC_JANE_HASH=$$apr1$$5iyu65pm$$m/6I35fjUT7.1CMnS2w9d1
- WUD_AUTH_BASIC_BOB_USER=bob
- WUD_AUTH_BASIC_BOB_HASH=$$apr1$$aefKbZEa$$ZSA5Y3zv9vDQOxr283NGx/
docker run \
-e WUD_AUTH_BASIC_JOHN_USER="john" \
-e WUD_AUTH_BASIC_JOHN_HASH='$apr1$8zDVtSAY$62WBh9DspNbUKMZXYRsjS/' \
-e WUD_AUTH_BASIC_JANE_USER="jane" \
-e WUD_AUTH_BASIC_JANE_HASH='$apr1$5iyu65pm$m/6I35fjUT7.1CMnS2w9d1' \
-e WUD_AUTH_BASIC_BOB_USER="bob" \
-e WUD_AUTH_BASIC_BOB_HASH='$apr1$aefKbZEa$ZSA5Y3zv9vDQOxr283NGx/' \
...
getwud/wud
How to generate a password hash
Using the htpasswd command
htpasswd -nib john doe
# Output: john:$apr1$8zDVtSAY$62WBh9DspNbUKMZXYRsjS/
Using an online generator
You can use an online htpasswd generator like wtools.io.