public class OIMConnection {
public static OIMclient getOIMConnection(String userName, String password, String t3URL, String authLoc){
Hashtable env = new Hashtable(); env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL, "weblogic.jndi.WLInitialContextFactory");
env.put(OIMClient.JAVA_NAMING_PROVIDER_URL,t3URL);
// Set system properties
System.setProperty("java.security.auth.login.config", authLoc);
System.setProperty("OIM.AppServerType", "wls");
System.setProperty("APPSERVER_TYPE", "wls");
OIMClient client = null;
try {
client = new OIMClient(env);
client.login(userName, password.toCharArray());
System.out.println("OIM Connection is successful : ");
} catch (Exception e) {
System.out.println("Error in gettting connection : "e.getMessage());
}
return client;
}
No comments:
Post a Comment