product-is icon indicating copy to clipboard operation
product-is copied to clipboard

Issue when filter users by username with pagination parameters

Open AnjanaSamindraPerera opened this issue 2 years ago • 1 comments

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.

Screenshot 2022-08-07 at 10 39 37

How to reproduce:

  1. Create users which contain userName with capital letters (Ex: Kamala, anjanaPerera, aNjana, loginUser1)
  2. 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

AnjanaSamindraPerera avatar Aug 07 '22 05:08 AnjanaSamindraPerera

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

sahandilshan avatar Aug 07 '22 18:08 sahandilshan