Search for users by Forgerock ClientSDK tools


This topic has 5 replies, 4 voices, and was last updated 4 years ago by Dusty.

  • Author
  • #4143


    I have two questions.
    One, What’s AMIdentityRepository.searchIdentities of the filter argument’s format?. I want to search for the users using ClientSDK tools of Forgerock OpenAM-12.0.0 by sunIdentityServerPPCommonNameSN.
    Two, about ClientSDK vs REST API. Which or Why you recommend this?

    Please give me your help. Regard.

     Victor Ake

    The documentation for AMIdentityRepository is here:

    And on your second question, it would be better and probably easier to use the REST APIs than the SDK. The development lately has been focused on the REST API.



    Thank you Victor.
    I read the documentation. However, I don’t understand AMIdentityRepository.searchIdentities of the pattern’s format.
    The documentation writes “pattern – Pattern to be used when searching.”
    Can I use regular expression in “pattern”?
    // I want to search for the users by sunIdentityServerPPCommonNameSN;
    String filter = “sunIdentityServerPPCommonNameSN=A*”;
    IdSearchResults isr = amIr.searchIdentities(IdType.USER,
    filter, new IdSearchControl());


     Peter Major

    Pattern is not a regexp, no. At best you can use *. Instead I think you should take a look at the IdSearchControl, and make sure you call setSearchModifiers on it (whilst using just a plain “*” for the pattern).


    Thank you Peter.
    I’m going to use IdSearchControl!



    A little bit late, but I landed on this forum topic via Google. Maybe this can be useful for other people. The pattern is used for the uid. Access logs from OpenDJ

    Pattern ‘*’ : uid=*
    Pattern ‘cn=dusty’ : uid=cn=dusty


Viewing 6 posts - 1 through 6 (of 6 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?