From f21c35c21ff207c722f9e7ea5fd266d7106340e0 Mon Sep 17 00:00:00 2001 From: rmartinc Date: Mon, 3 Jul 2023 09:44:53 +0200 Subject: [PATCH] Compare SSSD email ignoring the case Closes https://github.com/keycloak/keycloak/issues/21394 --- .github/scripts/run-ipa-tests.sh | 2 +- .../main/java/org/keycloak/federation/sssd/api/Sssd.java | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/scripts/run-ipa-tests.sh b/.github/scripts/run-ipa-tests.sh index f9941d0c9a..111eb028a9 100755 --- a/.github/scripts/run-ipa-tests.sh +++ b/.github/scripts/run-ipa-tests.sh @@ -24,7 +24,7 @@ if [[ "true" == "$1" ]]; then printf "%b" "password\n" | kinit admin ipa group-add --desc='test group' testgroup - ipa user-add emily --first=Emily --last=Jones --email=emily@jones.com --random + ipa user-add emily --first=Emily --last=Jones --email=Emily@jones.com --random ipa group-add-member testgroup --users=emily ipa user-add bart --first=bart --last=bart --email= --random ipa user-add david --first=david --last=david --random diff --git a/federation/sssd/src/main/java/org/keycloak/federation/sssd/api/Sssd.java b/federation/sssd/src/main/java/org/keycloak/federation/sssd/api/Sssd.java index 984a784c22..44fed724ea 100644 --- a/federation/sssd/src/main/java/org/keycloak/federation/sssd/api/Sssd.java +++ b/federation/sssd/src/main/java/org/keycloak/federation/sssd/api/Sssd.java @@ -113,12 +113,9 @@ public class Sssd { return false; } if (email != null) { - return email.equals(userModel.getEmail()); + return email.equalsIgnoreCase(userModel.getEmail()); } - if (email != userModel.getEmail()) { - return false; - } - return true; + return userModel.getEmail() == null; } @Override