diff --git a/files/authelia/configuration.template.yml b/files/authelia/configuration.template.yml index fca2494..01167a6 100644 --- a/files/authelia/configuration.template.yml +++ b/files/authelia/configuration.template.yml @@ -875,16 +875,18 @@ session: ## The inactivity time before the session is reset. If expiration is set to 1h, and this is set to 5m, if the user ## does not select the remember me option their session will get destroyed after 1h, or after 5m since the last ## time Authelia detected user activity. - # inactivity: '5 minutes' + ## Дефолты (5 минут / 1 час) для личного сервера слишком агрессивны: любая пауза в работе + ## заставляет логиниться заново. Держим сессию живой неделю простоя. + inactivity: "1 week" ## The time before the session cookie expires and the session is destroyed if remember me IS NOT selected by the ## user. - # expiration: '1 hour' + expiration: "1 month" ## The time before the cookie expires and the session is destroyed if remember me IS selected by the user. Setting ## this value to -1 disables remember me for this session cookie domain. If allowed and the user uses the remember ## me checkbox this overrides the expiration option and disables the inactivity option. - # remember_me: '1 month' + remember_me: "3 months" ## Cookie Session Domain default 'name' value. # name: 'authelia_session' @@ -1370,13 +1372,17 @@ identity_providers: ## The lifespans configure the expiration for these token types in the duration common syntax. In addition to this ## syntax the lifespans can be customized per-client. - # lifespans: - ## Configures the default/fallback lifespan for given token types. This behaviour applies to all clients and all - ## grant types but you can override this behaviour using the custom lifespans. - # access_token: '1 hour' - # authorize_code: '1 minute' - # id_token: '1 hour' - # refresh_token: '90 minutes' + ## Дефолты: access_token '1 hour', authorize_code '1 minute', id_token '1 hour', refresh_token '90 minutes'. + ## + ## Outline раз в час (после каждого auth.info, если lastSignedInAt старше часа) запускает + ## ValidateSSOAccessTask: обновляет access token по refresh token и дёргает userinfo. Если обновить + ## не удалось — ротирует jwtSecret пользователя и убивает ВСЕ свои сессии, то есть выкидывает на + ## повторный вход. С дефолтным refresh token в 90 минут это происходит почти при каждом визите. + lifespans: + custom: + outline: + access_token: "1 hour" + refresh_token: "3 months" ## Cross-Origin Resource Sharing (CORS) settings. # cors: @@ -1486,20 +1492,25 @@ identity_providers: # audience: [] ## Scopes this client is allowed to request. + ## offline_access нужен, чтобы Authelia выдала refresh token: без него Outline не может + ## продлить access token и убивает свою сессию (см. кастомный lifespan 'outline' выше). scopes: - "openid" - "profile" - "email" + - "offline_access" ## Grant Types configures which grants this client can obtain. ## It's not recommended to define this unless you know what you're doing. - # grant_types: - # - 'authorization_code' + grant_types: + - "authorization_code" + - "refresh_token" ## Response Types configures which responses this client can be sent. ## It's not recommended to define this unless you know what you're doing. - # response_types: - # - 'code' + ## Задан явно: без этого Authelia ругается на scope 'offline_access'. + response_types: + - "code" ## Response Modes configures which response modes this client supports. # response_modes: @@ -1512,14 +1523,16 @@ identity_providers: ## The custom lifespan name to use for this client. This must be configured independent of the client before ## utilization. Custom lifespans are reusable similar to authorization policies. - # lifespan: '' + lifespan: "outline" ## The consent mode controls how consent is obtained. - # consent_mode: 'auto' + ## 'pre-configured' — согласие запоминается на pre_configured_consent_duration, поэтому при + ## повторном входе экран согласия не показывается и редирект проходит незаметно. + consent_mode: "pre-configured" ## This value controls the duration a consent on this client remains remembered when the consent mode is ## configured as 'auto' or 'pre-configured' in the duration common syntax. - # pre_configured_consent_duration: '1 week' + pre_configured_consent_duration: "3 months" ## Requires the use of Pushed Authorization Requests for this client when set to true. # require_pushed_authorization_requests: false diff --git a/files/outline/docker-compose.template.yml b/files/outline/docker-compose.template.yml index 0b7dbec..b43bbac 100644 --- a/files/outline/docker-compose.template.yml +++ b/files/outline/docker-compose.template.yml @@ -35,7 +35,9 @@ services: OIDC_USERINFO_URI: 'https://auth.vakhrushev.me/api/oidc/userinfo' OIDC_LOGOUT_URI: 'https://auth.vakhrushev.me/logout' OIDC_USERNAME_CLAIM: 'email' - OIDC_SCOPES: 'openid profile email' + # offline_access — чтобы Authelia выдала refresh token. Без него Outline не может продлить + # access token, ValidateSSOAccessTask признаёт вход невалидным и сбрасывает все сессии. + OIDC_SCOPES: 'openid profile email offline_access' OIDC_DISPLAY_NAME: 'Authelia' SMTP_HOST: '{{ postbox_host }}'