Authentication
Set up authentication for your Deckyard installation.
Overview
Section titled “Overview”Deckyard supports authentication to secure your instance. By default, authentication is enabled but requires configuration. You can disable it explicitly by setting AUTH_ENABLED=false.
Authentication supports:
- Database-backed users with password authentication
- Magic link (passwordless) authentication via email
- Development bypass mode for local testing

AUTH_SECRET
Section titled “AUTH_SECRET”The secret key used for signing session tokens. This is required when authentication is enabled.
AUTH_SECRET=your-random-secret-string-at-least-32-charactersGenerate a secure secret:
# Using OpenSSLopenssl rand -base64 32
# Using Node.jsnode -e "console.log(require('crypto').randomBytes(32).toString('base64'))"Important:
- Use a long, random string (at least 32 characters recommended)
- Keep this secret secure and never commit it to version control
- Changing this secret will invalidate all existing sessions
User Configuration
Section titled “User Configuration”Users can be configured via environment variables or managed through the database.
AUTH_USERS_JSON
Section titled “AUTH_USERS_JSON”Define users in JSON format directly in the environment variable.
Simple format (email:password pairs):
# Single userAUTH_USERS_JSON={"user@example.com":"mypassword"}
# Multiple usersAUTH_USERS_JSON={"admin@example.com":"pass1","user@example.com":"pass2"}Extended format (with roles and names):
AUTH_USERS_JSON=[{"email":"user@example.com","password":"secret","name":"User","role":"user"}]AUTH_USERS_B64
Section titled “AUTH_USERS_B64”Base64-encoded user configuration. Useful when JSON characters cause issues in your environment.
# Encode your JSONecho '{"user@example.com":{"password":"secret","role":"admin"}}' | base64
# Use the encoded valueAUTH_USERS_B64=eyJ1c2VyQGV4YW1wbGUuY29tIjp7InBhc3N3b3JkIjoic2VjcmV0Iiwicm9sZSI6ImFkbWluIn19AUTH_ADMIN_EMAIL
Section titled “AUTH_ADMIN_EMAIL”Set the administrator email address. The user matching this email automatically receives admin privileges, regardless of their configured role.
AUTH_ADMIN_EMAIL=admin@yourdomain.comIf not set, no user has automatic admin privileges—roles must be assigned explicitly.
Magic Link Authentication
Section titled “Magic Link Authentication”Passwordless login via email links. Users receive a secure link that logs them in automatically.
Requirements:
- Email service configured (see Email Configuration)
- Database mode enabled for user storage
How it works:
- User enters their email address
- System sends a secure, time-limited link
- Clicking the link authenticates the user and creates a session
- Links expire after a single use or timeout (typically 15 minutes)
Users authenticated via magic link are stored in the database with auth_source: 'magic_link'.
Password Reset Flows
Section titled “Password Reset Flows”When using database-backed authentication, users can reset their passwords.
Requirements:
- Email service configured
- Database mode enabled
Flow:
- User requests a password reset
- System sends an email with a secure reset link
- User clicks the link and enters a new password
- All existing sessions are invalidated
- User is logged in with the new password
Rate limits:
- 3 reset requests per email per hour
- 10 reset requests per IP per hour
Development Bypass Mode
Section titled “Development Bypass Mode”For local development, you can bypass authentication entirely.
AUTH_DEV_BYPASS=trueWhen enabled:
- All requests are treated as coming from an admin user (
dev@local) - No login required
- Full admin privileges granted
⚠️ Security Warning: Never enable this in production. The server logs a security warning if AUTH_DEV_BYPASS is detected in a production environment.
Cookie Configuration
Section titled “Cookie Configuration”COOKIE_DOMAIN
Section titled “COOKIE_DOMAIN”Set a cookie domain for cross-subdomain single sign-on.
# Share sessions across all subdomainsCOOKIE_DOMAIN=.example.com
# Single domain onlyCOOKIE_DOMAIN=app.example.comSECURE_COOKIES
Section titled “SECURE_COOKIES”Force secure cookies (HTTPS only). Automatically enabled when running behind HTTPS.
SECURE_COOKIES=trueSession Behavior
Section titled “Session Behavior”- Sessions are valid for 14 days by default
- Sessions are stored as signed cookies (HttpOnly, SameSite=Lax)
- Password changes invalidate all existing sessions for that user
- Sessions are verified against the database on each request
Disabling Authentication
Section titled “Disabling Authentication”To run Deckyard without authentication (not recommended for production):
AUTH_ENABLED=falseWhen disabled, all users have anonymous admin access.