fix(auth): add email fallback scope for Grafana OAuth and set attribute paths
This commit is contained in:
1 parent
811d65526b
commit
94a143623b
2 files changed
+19
-1
No files matched your search
@@ -15,6 +15,20 @@ entries:
|
||||
identifiers:
|
||||
name: family
|
||||
|
||||
- model: authentik_providers_oauth2.scopemapping
|
||||
id: scope-grafana-email
|
||||
identifiers:
|
||||
managed: homelab/providers/oauth2/scope-grafana-email
|
||||
attrs:
|
||||
name: "Grafana OAuth Mapping: OpenID 'email' with fallback"
|
||||
scope_name: email
|
||||
description: "Email scope with fallback for users without email"
|
||||
expression: |
|
||||
return {
|
||||
"email": request.user.email or f"{request.user.username}@gunihome.ru",
|
||||
"email_verified": True
|
||||
}
|
||||
|
||||
- model: authentik_providers_oauth2.oauth2provider
|
||||
id: provider-grafana
|
||||
identifiers:
|
||||
@@ -31,7 +45,7 @@ entries:
|
||||
signing_key: !Find [authentik_crypto.certificatekeypair, [name, "authentik Self-signed Certificate"]]
|
||||
property_mappings:
|
||||
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, openid]]
|
||||
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, email]]
|
||||
- !KeyOf scope-grafana-email
|
||||
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, profile]]
|
||||
|
||||
- model: authentik_core.application
|
||||
|
||||
Reference in new issue
Block a user