Skip to Content
author's profile photo Former Member
Former Member

How to use the UME api in order to search the LDAP?

Hello,

I have an application which connects to the LDAP the portal is connecting to and search users according to a certain search criteria.

Here is the relevant piece of code:

Hashtable env = new Hashtable();
...
DirContext ctx = new InitialDirContext(env);
SearchControls controls = new SearchControls();
String filter = "firstName=..."
NamingEnumeration results = ctx.search("OU=OUs", filter, controls);

I would like to do this same search using the UME API.

Can someone please show me the equivalent code to it using the UME API?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 09, 2005 at 02:47 PM

    Hi Roy,

    I used the following code:

    IUserFactory ufact = UMFactory.getUserFactory();

    IUserSearchFilter usf = ufact.getUserSearchFilter();

    usf.setSearchAttribute( "com.sap.security.core.usermanagement",

    "lastname",

    theNameToBeSearched, ISearchAttribute.LIKE_OPERATOR, false);

    ISearchResult sr = ufact.searchUsers(usf);

    In some cases you will have to modify the datasource_configuration.xml to able to search for your company specific attributes of the LDAP.

    Regards,

    Rebecca

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.