How to use –sortOrder with Json Attribute on LDAP

Tagged: 

This topic has 2 replies, 2 voices, and was last updated 1 month, 2 weeks ago by Ludo.

  • Author
    Posts
  • #28761

    I have a set of Entries in LDAP, each entry has an attribute is Json format as sample bellow:

    user-custom-attrs:{"category":"creation","createdOn":"2021-10-25T10:38:58.198Z","updatedOn":"2021-10-25T10:38:58.198Z","createdBy":"1","updatedBy":"1"}

    My question is how to use ldapsearch with --sortOder to sort with user-custom-atts's attribute?.

    I already try with ldapsearch --baseDn ou=people,ou=sampel01,ou=identities --bindPassword password --sortOrder "user-custom-attrs:caseIgnoreJsonQueryMatch:=/category" --simplePageSize 10 --countEntries "(uid=*leonidas*)" but DS server said that “Unable to process the provided server-side sort request control because it references undefined ordering matching rule caseIgnoreJsonQueryMatch:=/category”

    #28764

    @ludo hope you can help me, ty sir

    #28765
     Ludo
    Moderator

    Hi,

    To be able to sort, you need an ordering matching rule. caseIgnoreJsonQueryMatch is a equality rule.

    There is an example of the use of a Json ordering rule in our documentation:
    https://backstage.forgerock.com/docs/ds/7.1/ldap-guide/search-ldap.html#server-side-sort

    --sortOrder +jsonToken:extensibleJsonOrderingMatch:true:true:/category is like to achieve what you need.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

©2022 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?