heph Authentik: grant offline_access scope (fixes spoke sync refresh-token 400)
The heph CLI requests scope "openid offline_access", but the Authentik heph OAuth2 provider only mapped openid/email/profile. Without the offline_access mapping the issued refresh token is bound to the login session rather than the 30-day refresh-token window; once the session lapses, hephd's refresh_token grant returns 400 Bad Request and spoke sync silently degrades (heph sync --status -> auth_failure: true). Add the built-in offline_access scope mapping to the provider's property_mappings and document the requirement in the service reference. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
cf63fcb5b5
commit
50a36ff93a
3 changed files with 16 additions and 0 deletions
|
|
@ -492,6 +492,10 @@ data:
|
||||||
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, openid]]
|
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, openid]]
|
||||||
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, email]]
|
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, email]]
|
||||||
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, profile]]
|
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, profile]]
|
||||||
|
# offline_access: heph CLI requests "openid offline_access"; without
|
||||||
|
# this mapping the refresh token is session-bound and hephd's
|
||||||
|
# refresh_token grant 400s once the session lapses (spoke sync dies).
|
||||||
|
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, offline_access]]
|
||||||
sub_mode: hashed_user_id
|
sub_mode: hashed_user_id
|
||||||
include_claims_in_id_token: true
|
include_claims_in_id_token: true
|
||||||
|
|
||||||
|
|
|
||||||
1
docs/changelog.d/heph-offline-access.bugfix.md
Normal file
1
docs/changelog.d/heph-offline-access.bugfix.md
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Granted the `offline_access` scope on the Authentik `heph` OAuth2 provider so hephaestus spokes receive a durable 30-day refresh token. Previously the refresh token was session-bound, so spoke sync would silently fail with a `400 Bad Request` on the `refresh_token` grant once the Authentik session lapsed.
|
||||||
|
|
@ -68,6 +68,17 @@ in the [[authentik]] blueprint (`argocd/manifests/authentik/configmap-blueprint.
|
||||||
- Issuer: `https://authentik.ops.eblu.me/application/o/heph/`
|
- Issuer: `https://authentik.ops.eblu.me/application/o/heph/`
|
||||||
- Audience / client id: `heph`
|
- Audience / client id: `heph`
|
||||||
- Restricted to the `admins` group (single-owner, sensitive data).
|
- Restricted to the `admins` group (single-owner, sensitive data).
|
||||||
|
- Scope mappings: `openid`, `email`, `profile`, **`offline_access`**.
|
||||||
|
|
||||||
|
> **`offline_access` is required for durable sync.** The `heph` CLI requests
|
||||||
|
> `scope = "openid offline_access"`, and a refresh token is only issued for the
|
||||||
|
> 30-day refresh-token window when the provider actually grants `offline_access`.
|
||||||
|
> Without that scope mapping the refresh token is bound to the login **session**;
|
||||||
|
> once the session lapses, hephd's `refresh_token` grant returns `400 Bad
|
||||||
|
> Request`, the bearer can't be refreshed, and spoke sync silently degrades
|
||||||
|
> (`heph sync --status` → `auth_failure: true`). `heph auth login` papers over it
|
||||||
|
> until the next session expiry. Keep `offline_access` in the provider's
|
||||||
|
> `property_mappings`.
|
||||||
|
|
||||||
Because no Authentik instance ships a device-code flow by default, the blueprint
|
Because no Authentik instance ships a device-code flow by default, the blueprint
|
||||||
also creates `default-device-code-flow` and binds it to the default brand's
|
also creates `default-device-code-flow` and binds it to the default brand's
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue