HAPPY NEW YEAR 2017

Identity And Access Management - Rajiv Dewan

Sample Code: Get User Organization using OIM 11g API

Requirement:

Need to find user Organization using OIM 11g API:

Solution:

Here is the sample code for the same. It will give you Organization Key of that user. You can fetch the Organization Name with that:

SearchCriteria criteria = new SearchCriteria("User Login", "XELSYSADM", SearchCriteria.Operator.EQUAL);UserManager usrService = oimClient.getService(UserManager.class);
Set retAttrs = new HashSet();
retAttrs.add(UserManagerConstants.AttributeName.USER_ORGANIZATION.getId());
List users = usrService.search(criteria, retAttrs, null);
System.out.println("Organization Key -- " + users.get(0).getAttribute("act_key"));


No comments:

Post a Comment