From c1d8e84742da90bf7f47167b03be8dbb4fa31c81 Mon Sep 17 00:00:00 2001 From: Oleh Astappiev <4512729+astappiev@users.noreply.github.com> Date: Mon, 21 Apr 2025 16:55:38 +0200 Subject: [PATCH] chore: add Remote Auth docs --- README.md | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 40ba939dc..3fb6412db 100644 --- a/README.md +++ b/README.md @@ -120,14 +120,36 @@ Password: admin123 The following environment variables can be configured: -| Variable Name | Description | Default Value | -|-------------------|---------------------------|---------------------------------------------------------------------| -| DATABASE_URL | JDBC connection URL | `jdbc:mariadb://${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}` | -| DATABASE_HOST | Database hostname | `mariadb` | -| DATABASE_PORT | Database port | `3306` | -| DATABASE_NAME | Database name | `booklore` | -| DATABASE_USERNAME | Database username for app | `root` | -| DATABASE_PASSWORD | Database password for app | **required** | +| Variable Name | Description | Default Value | +|------------------------------|-----------------------------------------|---------------------------------------------------------------------| +| DATABASE_URL | JDBC connection URL | `jdbc:mariadb://${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}` | +| DATABASE_HOST | Database hostname | `mariadb` | +| DATABASE_PORT | Database port | `3306` | +| DATABASE_NAME | Database name | `booklore` | +| DATABASE_USERNAME | Database username for app | `root` | +| DATABASE_PASSWORD | Database password for app | **required** | +| REMOTE_AUTH_ENABLED | Enable remote authentication | `false` | +| REMOTE_AUTH_CREATE_NEW_USERS | Auto-create users from remote auth | `true` | +| REMOTE_AUTH_HEADER_NAME | HTTP header containing user's name | `Remote-Name` | +| REMOTE_AUTH_HEADER_USER | HTTP header containing username | `Remote-User` | +| REMOTE_AUTH_HEADER_EMAIL | HTTP header containing user's email | `Remote-Email` | +| REMOTE_AUTH_HEADER_GROUPS | HTTP header containing user's groups | `Remote-Groups` | +| REMOTE_AUTH_ADMIN_GROUP | Group name that grants admin privileges | - | +| LOG_LEVEL | Log level for the application | `INFO` | +| ROOT_LOG_LEVEL | If you want to see all Spring logs | `INFO` | + +### Remote Authentication (Trusted Header SSO, Forward Auth) + +If you run BookLore behind a reverse proxy with remote authentication (middleware), +you can enable automatic login by setting `REMOTE_AUTH_ENABLED` to `true`. + +This allows you to use your existing authentication system (e.g., OAuth, SAML) to log in to BookLore. + +Example implementations: +- https://www.authelia.com/integration/trusted-header-sso/introduction/ +- https://caddyserver.com/docs/caddyfile/directives/forward_auth +- https://doc.traefik.io/traefik/middlewares/http/forwardauth/ +- https://github.com/sevensolutions/traefik-oidc-auth (Traefik OIDC Auth) ## 🤝 Community & Support