config:authelia-npm
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| config:authelia-npm [2026/03/13 13:22] – [Authelia Configuration] Wuff | config:authelia-npm [2026/03/19 22:34] (current) – [Redis for Authelia session] Wuff | ||
|---|---|---|---|
| Line 338: | Line 338: | ||
| By default, authentication is valid for 1 hour or 30 days when the remember me is checked on login. This can be changed in the authelia configuration.yml | By default, authentication is valid for 1 hour or 30 days when the remember me is checked on login. This can be changed in the authelia configuration.yml | ||
| + | |||
| + | |||
| + | ===== Authelia email backend ===== | ||
| + | gmail example for email backend. Requires google mail app password. | ||
| + | < | ||
| + | notifier: | ||
| + | ## You can disable the notifier startup check by setting this to true. | ||
| + | disable_startup_check: | ||
| + | |||
| + | ## | ||
| + | ## File System (Notification Provider) | ||
| + | ## | ||
| + | # | ||
| + | # filename: '/ | ||
| + | |||
| + | smtp: | ||
| + | address: ' | ||
| + | username: 'email address' | ||
| + | password: 'app password' | ||
| + | sender: ' | ||
| + | subject: ' | ||
| + | startup_check_address: | ||
| + | </ | ||
| + | |||
| + | ===== Authelia SSO backend ===== | ||
| + | |||
| + | Single sign on through authelia for booklore: | ||
| + | < | ||
| + | server: | ||
| + | endpoints: | ||
| + | authz: | ||
| + | forward-auth: | ||
| + | implementation: | ||
| + | authn_strategies: | ||
| + | - name: ' | ||
| + | schemes: | ||
| + | - ' | ||
| + | - ' | ||
| + | - name: ' | ||
| + | ext-authz: | ||
| + | implementation: | ||
| + | authn_strategies: | ||
| + | - name: ' | ||
| + | schemes: | ||
| + | - ' | ||
| + | - ' | ||
| + | - name: ' | ||
| + | auth-request: | ||
| + | implementation: | ||
| + | authn_strategies: | ||
| + | - name: ' | ||
| + | schemes: | ||
| + | - ' | ||
| + | - ' | ||
| + | - name: ' | ||
| + | legacy: | ||
| + | implementation: | ||
| + | authn_strategies: | ||
| + | - name: ' | ||
| + | - name: ' | ||
| + | |||
| + | |||
| + | ## | ||
| + | ## Identity Providers | ||
| + | ## | ||
| + | |||
| + | #Valid keys can be generated using the following commands: | ||
| + | #openssl genrsa -out private.pem 2048 | ||
| + | #openssl rsa -in private.pem -outform PEM -pubout -out public.pem | ||
| + | |||
| + | identity_providers: | ||
| + | oidc: | ||
| + | jwks: | ||
| + | - algorithm: ' | ||
| + | use: ' | ||
| + | key: | | ||
| + | -----BEGIN PRIVATE KEY----- | ||
| + | MIIEvQI.... | ||
| + | iulbfHg.... | ||
| + | -----END PRIVATE KEY----- | ||
| + | |||
| + | clients: | ||
| + | - | ||
| + | client_id: ' | ||
| + | client_name: | ||
| + | public: true | ||
| + | authorization_policy: | ||
| + | require_pkce: | ||
| + | pkce_challenge_method: | ||
| + | redirect_uris: | ||
| + | - ' | ||
| + | scopes: | ||
| + | - ' | ||
| + | - ' | ||
| + | - ' | ||
| + | - ' | ||
| + | - ' | ||
| + | response_types: | ||
| + | - ' | ||
| + | grant_types: | ||
| + | - ' | ||
| + | - ' | ||
| + | access_token_signed_response_alg: | ||
| + | userinfo_signed_response_alg: | ||
| + | token_endpoint_auth_method: | ||
| + | </ | ||
| + | |||
| + | Restart Authelia for the changes to take effect! | ||
| + | |||
| + | In booklore gui: | ||
| + | Settings -> OIDC Settings: | ||
| + | * In the top right click the settings icon (looks like a cog) | ||
| + | * Provider Name: Authelia | ||
| + | * Client ID: booklore | ||
| + | * Issuer URI: https:// | ||
| + | * Scope: openid profile email offline_access | ||
| + | * Username Claim: preferred_username | ||
| + | * Email Claim: email | ||
| + | * Display Name Claim: name | ||
| + | * Test, then click Save Settings. | ||
| + | * OIDC Enabled: Toggle to the on Position above the settings. | ||
| + | |||
| + | Further down on the page, " | ||
| + | |||
| + | {{.: | ||
| + | |||
| + | |||
| + | Make sure to remove the advanced nginx config in NPM and enable websocket support in NPM. | ||
| + | The OIDC integration replaces the proxy authelia protection. | ||
| + | |||
| + | ===== Redis for Authelia session ===== | ||
| + | |||
| + | Authelia stores session data in memory by default. This means whenever the container or server is restarted, all users will have to log in again as the session data is lost. To store data across restarts, Redis can be used as in memory database and cache. | ||
| + | |||
| + | Authelia docker compose file should be adjusted as following: | ||
| + | <code yaml> | ||
| + | name: authelia | ||
| + | services: | ||
| + | authelia: | ||
| + | image: authelia/ | ||
| + | container_name: | ||
| + | restart: unless-stopped | ||
| + | volumes: | ||
| + | - / | ||
| + | ports: | ||
| + | - 6091:9091 | ||
| + | environment: | ||
| + | - TZ=Europe/ | ||
| + | depends_on: | ||
| + | redis: | ||
| + | condition: service_started | ||
| + | redis: | ||
| + | image: redis: | ||
| + | container_name: | ||
| + | command: > | ||
| + | redis-server | ||
| + | --appendonly yes | ||
| + | --appendfsync everysec | ||
| + | --save 900 1 | ||
| + | --save 300 10 | ||
| + | --save 60 10000 | ||
| + | volumes: | ||
| + | - / | ||
| + | restart: unless-stopped | ||
| + | </ | ||
| + | |||
| + | And in / | ||
| + | < | ||
| + | session: | ||
| + | redis: | ||
| + | host: authelia-redis | ||
| + | port: 6379 | ||
| + | </ | ||
| + | |||
| + | Then stop and fully restart the authelia container. | ||
config/authelia-npm.1773408163.txt.gz · Last modified: by Wuff