product-is
product-is copied to clipboard
Issue when filter users by username with pagination parameters
Describe the issue: When creating users with usernames that contain capital letters and trying to retrieve them with GET request https://localhost:9443/scim2/Users?filter=userName+eq+{userName}&startIndex=1&count=1 expected result is not there.

How to reproduce:
- Create users which contain userName with capital letters (Ex: Kamala, anjanaPerera, aNjana, loginUser1)
- Try to retrieve them using GET request https://localhost:9443/scim2/Users?filter=userName+eq+{userName}&startIndex=1&count=1
Expected behavior: The expected result with userName should be received as a response.
Environment information (Please complete the following information; remove any unnecessary fields) :
- Product Version: IS 6.0.0-beta2-SNAPSHOT
- OS: Mac
This issue occurs when we use a case-sensitive database. When we save the user Bob
in a case-sensitive database like H2, it will save the username as it is (Bob
). But when we retrieve the username from the database using the select query, the value in the filter query (Ex: Bob
, bob
, boB
) will be converted into a lower case (bob
) and do the comparison. Since the database is case-sensitive, this comparison will always be case-sensitive; hence, the select query will never find the user (Bob
!= bob
). https://github.com/wso2/carbon-kernel/pull/3385 will fix this issue. This issue will not occur in case-insensitive databases like MYSQL