Friday, February 1, 2013

OIM 11g Deploying a Custom Event Handler

Version: Oracle Identity Manager 11g R1
Description: This guide demonstrates the process of setting up and deploying a custom event handler.  It also shows you how to remove an event handler. Custom event handlers can be developed to extend the functionality of OIM User Management Operations.

Required Jars
You must include the following jar files in your Event Handler Java project:
Location: <IDM_HOME>/server/platform
  • iam-platform-kernel,jar
  • iam-platform-util.jar
  • iam-platform-context.jar
  • iam-platform-authz-service.jar
Location: <idm_home>/designconsole/lib
  • oimclient.jar
  • xlAPI.jar
Location: <IDM_HOME>/server/client/oimclient.zip
  • spring.jar
  • commons-logging.jar
  • eclipselink.jar
The “wlfullclient.jar” has to be generated.
cd <mw_home>/wlserver_10.3/server/lib/
java -jar <mw_home>/modules/com.bea.core.jarbuilder_1.6.0.1.jar

Packaging Java Event Handler Project
After finishing your Java code for your event handler, make a jar file out from your project. Then create the metadata XML file and plugin XML file for your event handler. An example is given here.

Make a zip file with the following structure:
plugin.xml
lib/<eventHandlerName>.jar

Register Plugin to OIM
Modify "~/.bash_profile" to include the following variables:
ANT_HOME=/home/oracle/Oracle/Middleware/modules/org.apache.ant_1.7.1
PATH=$ANT_HOME/bin:$PATH 
EXPORT ANT_HOME

Modify "ant.properties" which is located in "<IDM_HOME>/server/plugin_utility". Given below is an example. Adjust accordingly.
wls.home=/home/oracle/Oracle/Middleware/wlserver_10.3
oim.home=/home/oracle/Oracle/Middleware/Oracle_IDM1/server
login.config=${oim.home}/config/authwl.conf
OIM.Username=xelsysadm
ServerURL=t3://localhost:14000
PluginZipToRegister=<AbsolutePathToPluginZip>

Execute the following command to register plugin:
cd /home/oracle/Oracle/Middleware/Oracle_IDM1/server/plugin_utility
ant -f pluginregistration.xml register

Importing Event Handler into MDS Schema
Modify "~/.bash_profile" to include the following variables:
OIM_ORACLE_HOME=/home/oracle/Oracle/Middleware/Oracle_IDM1
export OIM_OIM_ORACLE_HOME

Modify "weblogic.properties" which is located in the "<idm_home>/server/bin". Given below is an example. Adjust accordingly.
wls_servername=oim_server1
application_name=OIMMetadata
metadata_from_loc=/home/oracle/eventHandler
metadata_to_loc=/home/oracle/eventHandler
metadata_files=/metadata/EventHandlers.xml

Execute the "weblogicImportMetadata.sh"
./weblogicImportMetadata.sh
 weblogic Admin Name: weblogic
 weblogic Admin Password: yourPassword
 weblogic Admin URL: t3://localhost:7001

Purging OIM Cache
Modify "~/.bash_profile" to include the following variables:
WL_HOME=/home/oracle/Oracle/Middleware/wlserver_10.3
export WL_HOME

Navigate to "<IDM_HOME>/server/bin" and execute "PurgeCache.sh"
cd /home/oracle/Oracle/Middleware/Oracle_IDM1/server/bin
./PurgeCache.sh ALL
OIM Admin User: xelsysadm
OIM Admin Password: yourPassword
OIM URL: t3://localhost:14000

Removing an Event Handler
Navigate to <IDM_HOME>/server/plugin_utilty
Modify the "ant.properties" file
Execute the following command:
ant -f pluginregistration.xml unregister
Look at the PLUGINS table in the OIM schema. When prompted the name of the event handler to be deleted, look at the class name column in the PLUGINS table.

Modify “weblogic.properties” to specify the metadata files you want to delete. Look at the MDS_PATH table in the OIM_MDS schema and get the path full name there.
Navigate to <IDM_HOME>/server/bin and execute the "weblogicDeletemetadata.sh" script.
cd /home/oracle/Oracle/Middleware/Oracle_IDM1/server/bin
./weblogicDeletemetadata.sh

No comments:

Post a Comment