diff --git a/model/jpa/src/main/java/org/keycloak/models/jpa/RealmAdapter.java b/model/jpa/src/main/java/org/keycloak/models/jpa/RealmAdapter.java index 8eb89d5b79..b888f34a0b 100755 --- a/model/jpa/src/main/java/org/keycloak/models/jpa/RealmAdapter.java +++ b/model/jpa/src/main/java/org/keycloak/models/jpa/RealmAdapter.java @@ -658,7 +658,7 @@ public class RealmAdapter implements RealmModel { } else { builder.append(" and "); } - builder.append(attribute).append("='").append(entry.getValue()).append("'"); + builder.append(attribute).append(" like lower('%").append(entry.getValue().toLowerCase()).append("%')"); } TypedQuery query = em.createQuery(builder.toString(), UserEntity.class); List results = query.getResultList();