Skip to main content

Developing an Event Handler with OIM 11g R2



  • The process of any Oracle Identity Manager operation that goes through a predefined set of stages and executes some business logic in each stage is called an orchestration.
  • An event handler is a piece of code that is registered with an orchestration on various stages. These event handlers are invoked when the relevant orchestration stage is performed.
  • The supported orchestration stages in which a custom event handler can be registered are validation, preprocess, and postprocess.
  • Code will extend PostProcessHandler, PreprocessHandler  or ValidationHandler based on the kind of Event Handler desired.
Code Snippet:-

public EventResult execute(long processId, long eventId,
Orchestration orchestration) {
HashMap<String, Serializable> parameters = orchestration
.getParameters();
String company = getParamaterValue(parameters, "Company");
if ((company == null) || company.equals("")) {
company = “ABC”
orchestration.addParameter("Company", company);
}
return new EventResult();
}
private String getParamaterValue(HashMap<String, Serializable> parameters,
String key) {
if(parameters.containsKey(key)){
String value = (parameters.get(key) instanceof ContextAware) ? (String) ((ContextAware)
parameters
.get(key)).getObjectValue() : (String) parameters.get(key);
return value;
}
else{
return null;
}
}

After code is developed Event Handler package is created.

Folder Structure:-




Plugin.xml :- Format of Plugin.xml would be as below:

<?xml version="1.0" encoding="UTF-8" ?>
<oimplugins>
<plugins pluginpoint="oracle.iam.platform.kernel.spi.EventHandler">
<plugin pluginclass="com.oracle.oim.utility.eventhandler.PostEventHandler" version="1.0" name="PostEventHandler"/>
</plugins>
</oimplugins>

EventHandler.xml :- Format of Event Handler.xml would be as below:

<?xml version="1.0" encoding="UTF-8"?>
<eventhandlers xsi:schemaLocation="http://www.oracle.com/schema/oim/platform/kernel orchestration-handlers.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.oracle.com/schema/oim/platform/kernel"> 
<action-handler sync="FALSE" order="1000" name="PostProcessExtensionCreate" operation="CREATE" entity-type="User" class="com.oracle.oim.utility.eventhandler.PostEventHandler" stage="postprocess"/>
<action-handler sync="FALSE" order="1000" name="PostProcessExtensionModify" operation="MODIFY" entity-type="User" class="com.oracle.oim.utility.eventhandler.PostEventHandler" stage="postprocess"/> 
 </eventhandlers>

After code and xmls are developed and packaged it is registered with Oracle Identity Manager and can be tested.








Comments

  1. Such a nice thing you had provided here. While hiring with the people for certain position, these are the things to keep in mind. Thank you very much for providing this here. And i am expecting much more information from you

    Staffing Companies in Bangalore

    ReplyDelete

Post a Comment

Popular posts from this blog

Developing Prepopulate Adapter with OIM 11g R2

1.      Prepopulate Adapter in OIM uses the plugin point oracle.iam.request.plugins.PrePopulationAdapte r. 2.      Write the Java code which returns the value which has to be populated on the form. 3.      This code will implement the plugin point oracle.iam.request.plugins.PrePopulationAdapte r. Code Snippet: - package com.oracle.oim.utility.eventhandler; import java.io.Serializable; import java.util.Iterator; import java.util.List; import java.util.logging.Logger; import oracle.iam.identity.exception.NoSuchUserException; import oracle.iam.identity.exception.UserLookupException; import oracle.iam.identity.usermgmt.api.UserManager; import oracle.iam.identity.usermgmt.vo.User; import oracle.iam.platform.Platform; import oracle.iam.platform.authz.exception.AccessDeniedException; import oracle.iam.request.exception.RequestServiceException; import oracle.iam.request.vo.Beneficiary; ...

Custom Login Page Protection- OAM 11g R2

Create a login page with fields having username,password and requestid. Below is the sample login page : <%@page language="java" session="true" contentType="text/html;charset=ISO-8859-1"  %> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request. getServerPort()+path+"/"; String requestID = request.getParameter("request_id"); %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <font color="blue">Login Page </font><br><br> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Implementing css and javascript</title> <meta http-equi...

Oracle Traffic Director (OTD) configuration

Download the OTD software and install it on a server by running runInstaller command from <Binaries>/Disk1. Preferred is to configure the OTD as root user because when the administration server is configured as root, then Oracle Traffic Director starts the keepalived daemon automatically when you start instances that are part of a failover group, and stops the daemon when you stop the instances. Set Oracle_Home as the new Installed OTD Home. Run below command to configure the Admin server: <OTD_HOME>/otd/bin/tadm configure-server --port=8989 --user=admin --server-user=root --instance- home= <OTD_HOME> /otd/instance_name/otd_instance1 This command will ask for admin password and will create the admin server. Run Below command to start the admin server: <OTD_HOME> /otd/instance_name/otd_instance1/admin-server/bin/startserv Login to the OTD console on http://<host>:8989 as admin user.  Click New configuration: Click Next and create ne...