Recently, I was working on a silverlight solution and came across an issue where People WebService returned me the duplicate results for the people who are already part of the site collection. This issue can occur if SharePoint is using claim based authentication model.
On close inspection I found that the returned duplicate results were having different login names. For example if one result was
ads\john then the other one was
It is easy to remove such duplicates if you are programming against server side directly with the following API code:
However, if you are programming against Client object model, you do not have luxury of calling such API’s. For those scenarios , I wrote a small function which will take the Claim encoded login name and return the pure Windows login name.