simpleidserver / SimpleIdServer

OpenID, OAuth 2.0, SCIM2.0, UMA2.0, FAPI, CIBA & OPENBANKING Framework for ASP.NET Core
https://simpleidserver.com/
Apache License 2.0
722 stars 96 forks source link

SCIM SortBy with EF SqlServer producing duplicate rows and does not sort on non-ValueString properties #527

Open ray-gilbert opened 1 year ago

ray-gilbert commented 1 year ago

Looks like Linq join from Representation to attribute does not use fullpath so can end up with multiple results. Also, does not honor lastChild.SchemaAttribute.Type and only sorts on ValueString property value.

Have a fix if required - just not sure how to submit PR

simpleidserver commented 1 year ago

Hello, indeed the Sort feature is not working. The issue is fixed in the master and the following modifications have been made :

ray-gilbert commented 1 year ago

Thanks, well done. Solves my sorting issue.

What is the expected outcome for unhappy path e.g. SortBy = "meta.created" now sorts by date.

But SortBy = "created" throws an exception. Should scim throw an exception that explicity states that it has a bad SortBy term or just return default sort (s => s.id)?

simpleidserver commented 1 year ago

First sorry for the late reply and thank you to report this issue. The issue is fixed in the master branch. When the property specified by sortBy doesn't exist, then the representations are sorted by the Identifier.