From 90947404a5f5a3b884aca95492c09f65adf9af14 Mon Sep 17 00:00:00 2001 From: Seth Date: Mon, 4 Oct 2021 05:10:18 -0400 Subject: [PATCH] KEYCLOAK-16380 Make IdP display name available to idp link email subject (#7626) KEYCLOAK-16380 Make IdP display name available to idp link email subject --- .../email/freemarker/FreeMarkerEmailTemplateProvider.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/src/main/java/org/keycloak/email/freemarker/FreeMarkerEmailTemplateProvider.java b/services/src/main/java/org/keycloak/email/freemarker/FreeMarkerEmailTemplateProvider.java index 7bbf3f2485..d10172c4bc 100755 --- a/services/src/main/java/org/keycloak/email/freemarker/FreeMarkerEmailTemplateProvider.java +++ b/services/src/main/java/org/keycloak/email/freemarker/FreeMarkerEmailTemplateProvider.java @@ -145,8 +145,13 @@ public class FreeMarkerEmailTemplateProvider implements EmailTemplateProvider { BrokeredIdentityContext brokerContext = (BrokeredIdentityContext) this.attributes.get(IDENTITY_PROVIDER_BROKER_CONTEXT); String idpAlias = brokerContext.getIdpConfig().getAlias(); + String idpDisplayName = brokerContext.getIdpConfig().getDisplayName(); idpAlias = ObjectUtil.capitalize(idpAlias); + if (idpDisplayName != null) { + idpAlias = ObjectUtil.capitalize(idpDisplayName); + } + attributes.put("identityProviderContext", brokerContext); attributes.put("identityProviderAlias", idpAlias);