Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| services:authelia [2024/09/05 14:41] – willy | services:authelia [2024/09/18 13:56] (current) – willy | ||
|---|---|---|---|
| Line 33: | Line 33: | ||
| You need to copy the provided example configuration and edit to your needs: | You need to copy the provided example configuration and edit to your needs: | ||
| <code bash> | <code bash> | ||
| - | cd bin/ | + | cp bin/ |
| </ | </ | ||
| - | As an example, here is my configuration.yml, | + | As an example, here is my configuration.yml, |
| <file - configuration.yml> | <file - configuration.yml> | ||
| --- | --- | ||
| theme: ' | theme: ' | ||
| - | | ||
| server: | server: | ||
| address: ' | address: ' | ||
| endpoints: | endpoints: | ||
| - | | + | |
| - | normal: | + | |
| - | implementation: | + | |
| - | authn_strategies: | + | |
| - | - name: ' | + | |
| - | basic: | + | |
| - | implementation: | + | |
| - | authn_strategies: | + | |
| - | - name: ' | + | |
| - | schemes: | + | |
| - | - ' | + | |
| log: | log: | ||
| - | level: ' | + | <<< |
| - | format: ' | + | |
| - | file_path: '/ | + | |
| telemetry: | telemetry: | ||
| metrics: | metrics: | ||
| enabled: false | enabled: false | ||
| - | |||
| totp: | totp: | ||
| disable: false | disable: false | ||
| - | | ||
| webauthn: | webauthn: | ||
| disable: false | disable: false | ||
| - | |||
| identity_validation: | identity_validation: | ||
| reset_password: | reset_password: | ||
| jwt_secret: '<<< | jwt_secret: '<<< | ||
| - | |||
| authentication_backend: | authentication_backend: | ||
| - | password_reset: | + | <<< |
| - | disable: false | + | |
| - | file: # For simplicity, i use a file based storage for users | + | |
| - | path: '/ | + | |
| - | watch: true | + | |
| password_policy: | password_policy: | ||
| standard: | standard: | ||
| Line 94: | Line 70: | ||
| enabled: false | enabled: false | ||
| min_score: 3 | min_score: 3 | ||
| - | |||
| privacy_policy: | privacy_policy: | ||
| enabled: false | enabled: false | ||
| require_user_acceptance: | require_user_acceptance: | ||
| policy_url: '' | policy_url: '' | ||
| - | |||
| access_control: | access_control: | ||
| - | default_policy: | + | <<< |
| - | rules: | + | |
| - | - domain: ' | + | |
| - | policy: ' | + | |
| session: | session: | ||
| secret: '<<< | secret: '<<< | ||
| Line 119: | Line 89: | ||
| remember_me: | remember_me: | ||
| + | storage: | ||
| + | <<< | ||
| + | |||
| + | notifier: | ||
| + | <<< | ||
| + | |||
| + | identity_providers: | ||
| + | oidc: | ||
| + | <<< | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | This file has a few assumptions, | ||
| + | |||
| + | |||
| + | === Access Control === | ||
| + | |||
| + | This section is used to define how to access domains, and with which policy. I use single factor at this time, so: | ||
| + | < | ||
| + | access_control: | ||
| + | default_policy: | ||
| + | rules: | ||
| + | - domain: ' | ||
| + | policy: ' | ||
| + | </ | ||
| + | |||
| + | === Authentication Backend === | ||
| + | |||
| + | I choose to store passwords and users in a yaml text file, for my few users this is perfect and simple enough: | ||
| + | < | ||
| + | password_reset: | ||
| + | disable: false | ||
| + | file: | ||
| + | path: '/ | ||
| + | watch: true | ||
| + | </ | ||
| + | |||
| + | See below on how to add/create users. | ||
| + | |||
| + | === Storage === | ||
| + | |||
| + | Due to my very limited use case (less than 10 users) i am using SQLite3 as storage backend: | ||
| + | < | ||
| storage: | storage: | ||
| encryption_key: | encryption_key: | ||
| local: | local: | ||
| path: '/ | path: '/ | ||
| + | </ | ||
| + | |||
| + | === Notifier === | ||
| + | |||
| + | Authelia support both on-flie notifier, which is pretty simple to setup, or email based notifier. While email requires you to setup a dedicated email address for Authelia, it will allow users to reset their password without your actions, which might be desirable. | ||
| + | File based, simple, notifier: | ||
| + | < | ||
| notifier: | notifier: | ||
| - | disable_startup_check: | + | disable_startup_check: |
| filesystem: # Using email notifier is probably better: TBD | filesystem: # Using email notifier is probably better: TBD | ||
| filename: '/ | filename: '/ | ||
| - | ... | + | </code> |
| - | </file> | + | |
| - | This file has a few assumptions, | + | SMTP / email notifier: |
| + | < | ||
| + | notifier: | ||
| + | disable_startup_check: | ||
| + | smtp: | ||
| + | address: ' | ||
| + | username: ' | ||
| + | password: '<<< | ||
| + | sender: 'Authelia | ||
| + | </ | ||
| + | |||
| + | Note the **disable_startup_check**: you should set it to true to prevent authelia to crash at boot if network is not yet reachable. | ||
| + | |||
| + | === Endpoints === | ||
| - | Please note the **endpoints** configuration | + | Please note the **endpoints** configuration |
| * standard: which will be used by all supported services | * standard: which will be used by all supported services | ||
| * basic: which will be needed by some protocols like WebDAV and such | * basic: which will be needed by some protocols like WebDAV and such | ||
| + | |||
| + | < | ||
| + | endpoints: | ||
| + | authz: | ||
| + | normal: | ||
| + | implementation: | ||
| + | authn_strategies: | ||
| + | - name: ' | ||
| + | basic: | ||
| + | implementation: | ||
| + | authn_strategies: | ||
| + | - name: ' | ||
| + | schemes: | ||
| + | - ' | ||
| + | </ | ||
| This is **different** from the stock authelia configuration files and **requires** one important change to the NGINX snippets below, which i will point out. Do not forget to edit the snippets where indicated. | This is **different** from the stock authelia configuration files and **requires** one important change to the NGINX snippets below, which i will point out. Do not forget to edit the snippets where indicated. | ||
| + | |||
| + | === Log === | ||
| + | |||
| + | Moving logging to a separate file, remember to // | ||
| + | < | ||
| + | log: | ||
| + | level: ' | ||
| + | format: ' | ||
| + | file_path: '/ | ||
| + | </ | ||
| For the log file, you need to create and set permissions to **/ | For the log file, you need to create and set permissions to **/ | ||
| Line 145: | Line 202: | ||
| chmod 750 / | chmod 750 / | ||
| </ | </ | ||
| + | |||
| + | === OIDC Provider === | ||
| + | |||
| + | Setting up Authelia as OIDC Provider is useful to support services that support this protocol, like Jellyfin. See [[https:// | ||
| + | |||
| + | Add the following section to your configuration.yml: | ||
| + | < | ||
| + | identity_providers: | ||
| + | oidc: | ||
| + | hmac_secret: | ||
| + | jwks: | ||
| + | - key_id: ' | ||
| + | use: ' | ||
| + | key: | | ||
| + | -----BEGIN PRIVATE KEY----- | ||
| + | ... <<< | ||
| + | -----END PRIVATE KEY----- | ||
| + | enable_client_debug_messages: | ||
| + | minimum_parameter_entropy: | ||
| + | enforce_pkce: | ||
| + | enable_pkce_plain_challenge: | ||
| + | enable_jwt_access_token_stateless_introspection: | ||
| + | discovery_signed_response_alg: | ||
| + | discovery_signed_response_key_id: | ||
| + | require_pushed_authorization_requests: | ||
| + | authorization_policies: | ||
| + | policy_name: | ||
| + | default_policy: | ||
| + | rules: | ||
| + | - policy: ' | ||
| + | subject: ' | ||
| + | lifespans: | ||
| + | access_token: | ||
| + | authorize_code: | ||
| + | id_token: ' | ||
| + | refresh_token: | ||
| + | cors: | ||
| + | endpoints: | ||
| + | - ' | ||
| + | - ' | ||
| + | - ' | ||
| + | - ' | ||
| + | allowed_origins: | ||
| + | - ' | ||
| + | allowed_origins_from_client_redirect_uris: | ||
| + | </ | ||
| + | |||
| + | To generate **hmac_secret** use the following command: | ||
| + | <code bash> | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | To generate the **PRIVATE KEY** use the following command: | ||
| + | <code bash> | ||
| + | openssl genrsa -out private.pem 4096 && cat private.pem | ||
| + | </ | ||
| + | You can delete the generated files afterward. | ||
| + | |||
| + | === OIDC Client === | ||
| + | |||
| + | Each OIDC client must have it's own section in the Authelia configuration file. See [[https:// | ||
| + | |||
| + | < | ||
| + | identity_providers: | ||
| + | oidc: | ||
| + | << omissis, see OIDC Providers above >> | ||
| + | clients: | ||
| + | - client_id: ' <<< | ||
| + | client_name: | ||
| + | client_secret: | ||
| + | public: false | ||
| + | authorization_policy: | ||
| + | require_pkce: | ||
| + | pkce_challenge_method: | ||
| + | redirect_uris: | ||
| + | - ' | ||
| + | scopes: | ||
| + | - ' | ||
| + | - ' | ||
| + | - ' | ||
| + | userinfo_signed_response_alg: | ||
| + | token_endpoint_auth_method: | ||
| + | </ | ||
| + | |||
| + | To generate the **client_id**: | ||
| + | <code bash> | ||
| + | ./ | ||
| + | </ | ||
| + | |||
| + | To generate **client_secret**: | ||
| + | <code bash> | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | === Customization === | ||
| + | |||
| + | If you want to customize the look & feel of the login dialog, you can replace the logo and the favicon. | ||
| + | |||
| + | In your configuration path add the line: | ||
| + | < | ||
| + | server: | ||
| + | asset_path: '/ | ||
| + | </ | ||
| + | |||
| + | and drop in that folder two files: | ||
| + | * favicon.ico (must be an ico) | ||
| + | * logo.png (must be a png) | ||
| + | |||
| + | === Logout === | ||
| + | |||
| + | You can logout by going to the URL **https:// | ||
| + | |||
| ==== NGINX support files ==== | ==== NGINX support files ==== | ||