Wednesday, July 3, 2013

OIM JAVA API to connect OIM SSL Port

1. Assuming your java app is working with NON SSL port.
2. Make sure add the following jars into your Java program Classpath with following Order:

$WL_HOME/server/lib/wlfullclient.jar
$WL_HOME/server/lib/webserviceclient+ssl.jar
$WL_HOME/server/lib/wlcipher.jar
$WL_HOME/server/lib/cryptoj.jar
$WL_HOME/server/ext/Jakarta-oro-2.0.8.jar
$WL_HOME/server/ext/Javagroups-all.jar
$WL_HOME/server/lib/Commons-logging.jar
$WL_HOME/server/lib/Jrf-api.jar
$ORACLE_HOME/designconsole/lib/Oimclient.jar
$ORACLE_HOME/server/lib/Iam-platfrom-pluginframework.jar
$ORACLE_HOME/server/lib/Iam-platfrom-util.jar
$ORACLE_HOME/server/lib/Iam-platfrom-auth-client.jar
$ORACLE_HOME/server/lib/activation.jar


Note: sometimes order causes the failures.. try change the order of wlfullclient.jar & webserviceclient+ssl.jar

3. Identify the keystore for your Java program default JDK (usually JVM Jre/lib/security/cacerts) and import the   OIM server cert - rootCA into this keystore. Make sure this cert entry type needs to be trustedCertEntry

4. set the envrionment variable before classpath : TRUSTSTORE_LOCATION=<<keystore file path>>

5. In the Java code change the OIM URL to SSL port
    OIM_URL="t3s://<<host>>:<<ssl port>>;
6. compile and run.

In case cacerts store you are using customer jks file and needs to change then add these following to Java runtime params..

 System.setProperty("javax.net.ssl.trustStoreType","JKS");
 System.setProperty("javax.net.ssl.trustStore","C:/designconsole/cacerts");
 System.setProperty("javax.net.ssl.trustStorePassword","changeit");

or

 -Djavax.net.ssl.trustStoreType=JKS -Djavax.net.ssl.trustStore=C:/designconsole/cacerts -Djavax.net.ssl.trustStorePassword=changeit  


 All the best