cancel
Showing results for 
Search instead for 
Did you mean: 

Search UME/LDAP for a user by e-mail

Former Member
0 Kudos

Hi all,

I would like to search the LDAP/ UME and retrieve a user using the e-mail id defined in the user's profile.

Thanks in advance

Rgds,

Subu

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Subramaniyam,

This should not be a tough job -

Have a look at the code snippet below ...

It searches the users based on the first name.

Just replace the Attribute "firstname" with the attribute for emailid

IUserFactory userFact = UMFactory.getUserFactory();

//getting UserFilter for first name

IUserSearchFilter userFilter1 = userFact.getUserSearchFilter();

//setting search attributes for userFilter1

userFilter1.setSearchAttribute(

IPrincipal.DEFAULT_NAMESPACE,

"firstname",

IConstants.str_fname,

ISearchAttribute.LIKE_OPERATOR,

false);

//populating result for first name

ISearchResult result1 = userFact.searchUsers(userFilter1);

The result1 contains the results i.e. all those who match the given first name.

Thanks,

Sam