There is a small issue with how realm display names are handled in email templates when the displayName of the realm is an empty string. This results in an email with a missing <realm-name> placeholder.
Example email body:
Someone requested a login link to
Click to log in.
Cause:
The `realmName˛ attribute is initially set with proper checks for empty strings.
However, Keycloak's FreeMarkerEmailTemplateProvider overrides this attribute without handling empty strings properly.
Enhancement Request
We'd like to enhance the email behavior so that if the OAuth client has a name, it is used in place of the realm's displayName.
Proposed Fix and Enhancement
Bug Fix:
Rename the realmName attribute to avoid conflicts with Keycloak's default behavior, ensuring empty strings are handled correctly.
Enhancement Implementation:
Modify the email logic to prefer the client's name (if available) over the realm's displayName or name.
Description
Bug Report
There is a small issue with how realm display names are handled in email templates when the
displayName
of the realm is an empty string. This results in an email with a missing<realm-name>
placeholder.Example email body:
Cause:
FreeMarkerEmailTemplateProvider
overrides this attribute without handling empty strings properly.Enhancement Request
We'd like to enhance the email behavior so that if the OAuth client has a name, it is used in place of the realm's displayName.
Proposed Fix and Enhancement
Bug Fix:
realmName
attribute to avoid conflicts with Keycloak's default behavior, ensuring empty strings are handled correctly.Enhancement Implementation: