From 9180182d5b685e18aeec307a0244936cd79d1044 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 21 Aug 2025 16:27:10 +0200 Subject: [PATCH] Optimized variables --- roles/web-app-keycloak/templates/import/realm.json.j2 | 2 +- roles/web-app-mastodon/templates/env.j2 | 2 +- roles/web-app-matrix/templates/synapse/homeserver.yaml.j2 | 2 +- roles/web-app-nextcloud/templates/config/oidc.config.php.j2 | 2 +- roles/web-app-pixelfed/templates/env.j2 | 4 ++-- roles/web-app-taiga/templates/env.j2 | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/roles/web-app-keycloak/templates/import/realm.json.j2 b/roles/web-app-keycloak/templates/import/realm.json.j2 index 0d6938d6..47294474 100644 --- a/roles/web-app-keycloak/templates/import/realm.json.j2 +++ b/roles/web-app-keycloak/templates/import/realm.json.j2 @@ -1295,7 +1295,7 @@ "user.attribute": "username", "id.token.claim": "true", "access.token.claim": "true", - "claim.name": "{{OIDC.ATTRIBUTES.USERNAME}}", + "claim.name": "{{ OIDC.ATTRIBUTES.USERNAME }}", "jsonType.label": "String" } }, diff --git a/roles/web-app-mastodon/templates/env.j2 b/roles/web-app-mastodon/templates/env.j2 index 7572d52b..eadfb2e7 100644 --- a/roles/web-app-mastodon/templates/env.j2 +++ b/roles/web-app-mastodon/templates/env.j2 @@ -65,7 +65,7 @@ OIDC_ISSUER={{ OIDC.CLIENT.ISSUER_URL }} OIDC_DISCOVERY=true OIDC_SCOPE="openid,profile,email" # @see https://stackoverflow.com/questions/72108087/how-to-set-the-username-of-mastodon-by-log-in-via-keycloak -OIDC_UID_FIELD={{OIDC.ATTRIBUTES.USERNAME}} +OIDC_UID_FIELD={{ OIDC.ATTRIBUTES.USERNAME }} OIDC_CLIENT_ID={{ OIDC.CLIENT.ID }} OIDC_REDIRECT_URI=https://{{ domains | get_domain(application_id) }}/auth/auth/openid_connect/callback OIDC_SECURITY_ASSUME_EMAIL_IS_VERIFIED=true diff --git a/roles/web-app-matrix/templates/synapse/homeserver.yaml.j2 b/roles/web-app-matrix/templates/synapse/homeserver.yaml.j2 index fdc21575..9ff2033f 100644 --- a/roles/web-app-matrix/templates/synapse/homeserver.yaml.j2 +++ b/roles/web-app-matrix/templates/synapse/homeserver.yaml.j2 @@ -57,7 +57,7 @@ oidc_providers: scopes: ["openid", "profile"] user_mapping_provider: config: - localpart_template: "{% raw %}{{ user.{% endraw %}{{OIDC.ATTRIBUTES.USERNAME}}{% raw %}}}{% endraw %}" + localpart_template: "{% raw %}{{ user.{% endraw %}{{ OIDC.ATTRIBUTES.USERNAME }}{% raw %}}}{% endraw %}" display_name_template: "{% raw %}{{ user.name }}{% endraw %}" backchannel_logout_enabled: true {% endif %} diff --git a/roles/web-app-nextcloud/templates/config/oidc.config.php.j2 b/roles/web-app-nextcloud/templates/config/oidc.config.php.j2 index 18796348..a251a3ea 100644 --- a/roles/web-app-nextcloud/templates/config/oidc.config.php.j2 +++ b/roles/web-app-nextcloud/templates/config/oidc.config.php.j2 @@ -102,7 +102,7 @@ return array ( 'mail' => 'email', 'quota' => '{{ ldap.user.attributes.nextcloud_quota }}', # 'home' => 'homeDirectory', # Not implemented yet - 'ldap_uid' => '{{OIDC.ATTRIBUTES.USERNAME}}', + 'ldap_uid' => '{{ OIDC.ATTRIBUTES.USERNAME }}', # 'groups' => 'ownCloudGroups', # Not implemented yet # 'login_filter' => 'realm_access_roles', // 'photoURL' => 'picture', diff --git a/roles/web-app-pixelfed/templates/env.j2 b/roles/web-app-pixelfed/templates/env.j2 index e3107ad3..a9bc0a3d 100644 --- a/roles/web-app-pixelfed/templates/env.j2 +++ b/roles/web-app-pixelfed/templates/env.j2 @@ -145,8 +145,8 @@ PF_OIDC_AUTHORIZE_URL="{{ OIDC.CLIENT.AUTHORIZE_URL }}" PF_OIDC_TOKEN_URL="{{OIDC.CLIENT.TOKEN_URL}}" PF_OIDC_PROFILE_URL="{{ OIDC.CLIENT.USER_INFO_URL }}" PF_OIDC_LOGOUT_URL="{{OIDC.CLIENT.LOGOUT_URL}}" -PF_OIDC_USERNAME_FIELD="{{OIDC.ATTRIBUTES.USERNAME}}" -PF_OIDC_FIELD_ID="{{OIDC.ATTRIBUTES.USERNAME}}" +PF_OIDC_USERNAME_FIELD="{{ OIDC.ATTRIBUTES.USERNAME }}" +PF_OIDC_FIELD_ID="{{ OIDC.ATTRIBUTES.USERNAME }}" PF_OIDC_CLIENT_SECRET={{ OIDC.CLIENT.SECRET }} PF_OIDC_CLIENT_ID={{ OIDC.CLIENT.ID }} PF_OIDC_SCOPES="openid profile email" diff --git a/roles/web-app-taiga/templates/env.j2 b/roles/web-app-taiga/templates/env.j2 index a11026d4..8b2a8ec9 100644 --- a/roles/web-app-taiga/templates/env.j2 +++ b/roles/web-app-taiga/templates/env.j2 @@ -76,7 +76,7 @@ OPENID_TOKEN_URL="{{OIDC.CLIENT.TOKEN_URL}}" OPENID_CLIENT_ID="{{ OIDC.CLIENT.ID }}" OPENID_CLIENT_SECRET="{{ OIDC.CLIENT.SECRET }}" OPENID_NAME="{{ OIDC.BUTTON_TEXT }}" -OPENID_USERNAME_FIELD="{{OIDC.ATTRIBUTES.USERNAME}}" +OPENID_USERNAME_FIELD="{{ OIDC.ATTRIBUTES.USERNAME }}" # Optional: # OPENID_ID_FIELD="sub" # OPENID_FULLNAME_FIELD="name"