It's all about IAM

Getting API Instance in OIM 11g R2

Getting OIMClient in Oracle Identity Manager 11g R2



public void getOIMCLient(){
        OIMClient oimClient = null;
      
  try{
    System.setProperty("APPSERVER_TYPE", "wls");
    final String USERNAME = "xelsysadm";
    final String PASSWORD = "Password12";

    final String PROVIDER_URL = "t3://OIMHOST:OIMPORT/identity";
    final Hashtable env = new Hashtable();
     env.put(OIMClient.JAVA_NAMING_PROVIDER_URL, PROVIDER_URL);

     env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL,     
                                   OIMClient.WLS_CONTEXT_FACTORY);
     env.put("APPSERVER_TYPE", "wls");
     oimClient = new OIMClient(env);
     oimClient.login(USERNAME, PASSWORD.toCharArray());
     System.out.println("oimClient :: " + oimClient);
    }catch(Exception e){
        e.printStackTrace();
    }
  }