Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Realm DisplayName Bug with Email Content enhancement #97

Open
vilmosnagy opened this issue Nov 26, 2024 · 0 comments · May be fixed by #98
Open

Fix Realm DisplayName Bug with Email Content enhancement #97

vilmosnagy opened this issue Nov 26, 2024 · 0 comments · May be fixed by #98

Comments

@vilmosnagy
Copy link

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:

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.
vilmosnagy added a commit to realCity/keycloak-magic-link that referenced this issue Nov 26, 2024
vilmosnagy added a commit to realCity/keycloak-magic-link that referenced this issue Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant