Getting USR_KEY using User login


public static String getUserKey(String userLogin) {
Logger logger = Logger.getLogger(UserDetail.class);
logger.debug("---- getUserKey started ----");
logger.debug("userLogin: " + userLogin);

String userKey = null;
@SuppressWarnings("rawtypes")
Map searchFilter = new HashMap<String, String>();
tcResultSet tcresultSet = null;
tcUserOperationsIntf userOperationsIntf = null;
OIMClient client = null;

if (userLogin != null) {
userLogin = userLogin.trim();
}
searchFilter.put("Users.User ID", userLogin);
try {
CustomOIMClient c = new CustomOIMClient();
client = c.getAdminConnection();// check post to use local code for OIMClient connection
logger.debug("Connected to OIM Client");
userOperationsIntf = client.getService(tcUserOperationsIntf.class);
tcresultSet = userOperationsIntf.findAllUsers(searchFilter);
if (tcresultSet != null) {
userKey = tcresultSet.getStringValue("USR_KEY");//USR_STATUS
logger.debug("User found with key: " + userKey);
}
} catch (Exception e) {
e.printStackTrace();
logger.debug(e.getMessage());
} finally {
client = null;
logger.debug("client is initialized to null");

}
logger.debug("---- getUserKey completed ----");
return userKey;
}

Comments

Popular posts from this blog

Rules in Sailpoint

Sailpoint Installation Steps (IdentityIQ 7.3 Installation in Windows Machine)

How to create provisioning plan in Sailpoint