|
| Want to see something? |
If you have any suggestion or want to see something here,Please let me know,
(Note:Only related to Identity Management or may be something useful to all) |
|
|
|
Code for getting utility and database instance using OIM API using singature method.
System.setProperty("java.security.policy", System.getProperty("XL.HomeDir")+"/config/xl.policy");
System.setProperty("log4j.configuration", System.getProperty("XL.HomeDir")+"/config/log.properties");
System.setProperty("java.security.auth.login.config", System.getProperty("XL.HomeDir") +"/config/auth.conf");
ConfigurationClient client = ConfigurationClient.getConfigurationClient();
Properties environmenVariable = client.getComplexSetting("Discovery.CoreServer").getAllSettings();
tcSignatureMessage SignatureMsg = tcCryptoUtil.sign("xelsysadm", "PrivateKey");
tcUtilityFactory varUtilityFactory = new tcUtilityFactory(environmenVariable, SignatureMsg);
//here how you will get database which is tcDataProvider
XLClientSecurityAssociation.setThreadLoginSession(ioUtilityFactory.getLoginSession());
database = (tcDataProvider) XLClientSecurityAssociation.getLoginSession().runAs(new PrivilegedAction(){
public Object run(){
try{
return new tcDataBaseClient();
}catch (Exception e){
//your exception handler
e.printStackTrace();
return e;
}
}
});
|