Wednesday, April 30, 2014

How to create a OIM Client connection on your local machine?

               
As soon as  you start working on OIM, you will need to create connection to OIM to test your API code. Though is fairly simple sometimes require lot of efforts for first timers.


  1. List of JAR files needed in the class path.
    1. OIMClient.jar
    2. WLFullClient.jar
    3. Eclipselink.jar
    4. Jrf-api.jar
    5. Spring.jar
    6. Commons-logging.jar
    7. Authwl.conf
  2.  For 2-7 extract the jar from oimclient.zip located at path OIM_Home/server/client and for OIMClient.jar use OIM_Home/designconsole/lib directory.
  3. Below is the code to connect:

        oracle.iam.platform.OIMClient client = null;

            try {
                            String oimURL = "";                                                  
            String oimUserName = "";                                                 
            String oimPassword = "";   
                HashMap filterMap = new HashMap();
                HashMap dataMap = new HashMap();

            String OIMUserName = "xelsysadm";
            String OIMPassword = "Admin123";
            String OIMURL = "t3://localhost:14000/";
            String OIMInitialContextFactory = "weblogic.jndi.WLInitialContextFactory";
            java.util.Hashtable env = new java.util.Hashtable();
            System.setProperty("OIM.AppServerType", "wls");//Server Type wls for weblogic
            System.setProperty("APPSERVER_TYPE", "wls"); //Server Type wls for weblogic
            System.setProperty("weblogic.Name", "oim_server1"); //Specify the name of the oim server
            System.setProperty("java.security.auth.login.config", "../conf/authwl.conf"); //path to authwl.config
            env.put(oracle.iam.platform.OIMClient.JAVA_NAMING_FACTORY_INITIAL, OIMInitialContextFactory);
            env.put(oracle.iam.platform.OIMClient.JAVA_NAMING_PROVIDER_URL, OIMURL);
System.out.println("Starting Connection”);
                client = new oracle.iam.platform.OIMClient(env);
                                 System.out.println("Obtained OIM Connection”); 

If you have any questions or need more details, please update the comments. I will try my best to answer them.

-gaurav

1 comment:

  1. Harrah's Cherokee Casino Resort - Mapyro
    Harrah's Cherokee Casino Resort is 포천 출장마사지 in the mountains, just 5 minutes from 충주 출장안마 the Great Smoky Mountains and 2.4 miles from McCarran International 제천 출장마사지 Airport.Hotel 통영 출장샵 highlights: Walking 보령 출장안마 distance to Harrah's Cherokee Casino and 17 miNearest airport: McCarran International Airport Rating: 8.2/10 · ‎1,785 reviews

    ReplyDelete