Skip to content

Commit

Permalink
Merge pull request #29 from GluuFederation/issues_2444
Browse files Browse the repository at this point in the history
fix(oxTrust): user searching is case sensitive for postgres
  • Loading branch information
yurem authored Nov 20, 2024
2 parents 60a36d7 + 46b7d47 commit 3c9f970
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3c9f970

Please sign in to comment.