Hi, there!
One of our customers stated that when they made an api call to api/users/search and filtering by externalIdentity
, they didn’t get a result.
https://*********/sonar/api/users/search?externalIdentity=****
I made some test and they were right up to a certain point:
With one user:
But with another user:
I have made a script in order to get which users were affected with this behaviour and get a pattern to investigate what’s going on and I couldn’t get it.
First, I retrieve all users with sonar/api/users/search
. Second filter by users in the external Identity provider. Then, I made a call to sonar/api/users/search?externalIdentity=****
with the externalIdentity param I retrieved from the first call:
I made some tests in four another instances of SonarQube (SonarQube for Server) 9.9.7 LTA and in every single one we have this behaviour. Some users respond to the search by external ID, some not without a pattern I could find:
BUT When I make the test in a 10.7 instance, this behaviour does not occur:
I have been looking for an answer into the SonarQube code and I found that the code in the SearchAction for the API is completely different in 9.9 and in 10.x.
In 9.9 looks this way:
And it looks good to me, but I cannot test further. Is it maybe a bug?
TLDR: In 9.9 LTA, api/users/search?externalIdentity= is not retreiving data from some users