This commit is contained in:
soraefir
2026-05-31 16:05:58 +02:00
parent eef8730851
commit 476b79bf34
2 changed files with 11 additions and 6 deletions

View File

@@ -5,6 +5,16 @@ metadata:
app: immich app: immich
entries: entries:
- model: authentik_providers_oauth2.scopemapping
identifiers:
name: "Homepage Custom Scope: Groups"
attrs:
scope_name: "groups"
description: "Pass user groups array to Homepage for conditional element rendering"
expression: |
return {
"groups": [group.name for group in request.user.ak_groups.all()]
}
# 1. Create the OAuth2/OIDC Provider # 1. Create the OAuth2/OIDC Provider
- model: authentik_providers_oauth2.oauth2provider - model: authentik_providers_oauth2.oauth2provider
identifiers: identifiers:
@@ -21,7 +31,6 @@ entries:
!Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]] !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
client_type: "confidential" client_type: "confidential"
client_id: "homepage" client_id: "homepage"
client_secret: !Env HOMEPAGE_VAR_OAUTH_SECRET client_secret: !Env HOMEPAGE_VAR_OAUTH_SECRET
access_code_validity: "minutes=5" access_code_validity: "minutes=5"
token_validity: "days=30" token_validity: "days=30"
@@ -47,7 +56,7 @@ entries:
] ]
- !Find [ - !Find [
authentik_providers_oauth2.scopemapping, authentik_providers_oauth2.scopemapping,
[name, "authentik default OAuth Mapping: OpenID 'group'"], [name, "Homepage Custom Scope: Groups"],
] ]
# 2. Create the Application and link it to the Provider # 2. Create the Application and link it to the Provider

View File

@@ -48,10 +48,6 @@ entries:
authentik_providers_oauth2.scopemapping, authentik_providers_oauth2.scopemapping,
[name, "authentik default OAuth Mapping: OpenID 'profile'"], [name, "authentik default OAuth Mapping: OpenID 'profile'"],
] ]
- !Find [
authentik_providers_oauth2.scopemapping,
[name, "authentik default OAuth Mapping: OpenID 'group'"],
]
- model: authentik_core.application - model: authentik_core.application
identifiers: identifiers: