From 7ce58a72035af67ceb1ae9760f52bbdb6c134194 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 21 Feb 2025 00:37:06 +0100 Subject: [PATCH] Solved comma bug --- .../templates/import/realm.json.j2 | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/roles/docker-keycloak/templates/import/realm.json.j2 b/roles/docker-keycloak/templates/import/realm.json.j2 index 8a8081bc..5496cbba 100644 --- a/roles/docker-keycloak/templates/import/realm.json.j2 +++ b/roles/docker-keycloak/templates/import/realm.json.j2 @@ -833,19 +833,20 @@ "alwaysDisplayInConsole": false, "clientAuthenticatorType": "client-secret", "secret": "{{oidc.client.secret}}", - "redirectUris": [ - {%- for application, domain in domains.items() -%} - {%- if applications[application] is defined and ( applications | get_oauth2_enabled(application) or applications | get_oidc_enabled(application)) -%} - {%- if domain is string -%} - "https://{{ domain }}/*"{% if not loop.last %},{% endif %} - {%- else -%} - {%- for d in domain -%} - "https://{{ d }}/*"{% if not (loop.last and loop.parent.last) %},{% endif %} - {%- endfor -%} - {%- endif -%} - {%- endif -%} - {%- endfor -%} - ], + {%- set redirect_uris = [] %} + {%- for application, domain in domains.items() %} + {%- if applications[application] is defined and (applications | get_oauth2_enabled(application) or applications | get_oidc_enabled(application)) %} + {%- if domain is string %} + {%- set _ = redirect_uris.append("https://{}/*".format(domain)) %} + {%- else %} + {%- for d in domain %} + {%- set _ = redirect_uris.append("https://{}/*".format(d)) %} + {%- endfor %} + {%- endif %} + {%- endif %} + {%- endfor %} + + "redirectUris": {{ redirect_uris | tojson }}, "webOrigins": [ "https://*.{{primary_domain}}" ],