From 46b7d47d6bccc388c45ee9c8c60e6737951f8ad2 Mon Sep 17 00:00:00 2001 From: shekhar16 Date: Wed, 20 Nov 2024 01:04:59 +0530 Subject: [PATCH] fix(oxTrust): user searching is case sensitive for postgres Signed-off-by: shekhar16 --- .../java/org/gluu/oxtrust/service/PersonService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/oxTrust/service/src/main/java/org/gluu/oxtrust/service/PersonService.java b/oxTrust/service/src/main/java/org/gluu/oxtrust/service/PersonService.java index 3be5b028..03ebb9af 100644 --- a/oxTrust/service/src/main/java/org/gluu/oxtrust/service/PersonService.java +++ b/oxTrust/service/src/main/java/org/gluu/oxtrust/service/PersonService.java @@ -225,12 +225,12 @@ private Filter buildFilter(String pattern) { } private Filter buildFilterForList(String pattern) { - String[] targetArray = new String[] { pattern }; - Filter uidFilter = Filter.createSubstringFilter(OxConstants.UID, null, targetArray, null); - Filter mailFilter = Filter.createSubstringFilter(OxTrustConstants.mail, null, targetArray, null); - Filter nameFilter = Filter.createSubstringFilter(OxTrustConstants.displayName, null, targetArray, null); + String[] targetArray = new String[] { pattern.toLowerCase() }; + Filter uidFilter = Filter.createSubstringFilter(Filter.createLowercaseFilter(OxConstants.UID), null, targetArray, null); + Filter mailFilter = Filter.createSubstringFilter(Filter.createLowercaseFilter(OxTrustConstants.mail), null, targetArray, null); + Filter nameFilter = Filter.createSubstringFilter(Filter.createLowercaseFilter(OxTrustConstants.displayName), null, targetArray, null); - Filter snFilter = Filter.createSubstringFilter(OxTrustConstants.sn, null, targetArray, null); + Filter snFilter = Filter.createSubstringFilter(Filter.createLowercaseFilter(OxTrustConstants.sn), null, targetArray, null); Filter searchFilter = Filter.createORFilter(uidFilter, mailFilter, nameFilter, snFilter); return searchFilter; }