Monday, February 11, 2019

Pre-populate plug-ins

Introduction :

In OIM ,  a plug-in is a logical component that extends the functionality of features provided by Oracle Identity Manager.
The plug-in framework enables you to define, register, and configure plug-ins, which extend the functionality provided by features. Plug-ins can be predefined or custom-developed, and they are utilized at plug-in points.
A plug-in point is a specific point in the business logic where extensibility can be provided.
You can extend the plug-in interface based on the business requirements and register them as plug-ins. To do this, you develop a Plugin Java class and compile it before archiving in a JAR file, define plug-in metadata in an XML file, and ZIP these artifacts as a plug-in package that is ready to deploy.

Plug-in Points : 

There are 10 plug-in points in OIM, namely :
  • oracle.iam.request.plugins.PrePopulationAdapter
  • oracle.iam.scheduler.vo.TaskSupport
  • oracle.iam.request.plugins.RequestDataValidator
  • oracle.iam.identity.usermgmt.api.UserNamePolicy
  • oracle.iam.platform.kernel.spi.EventHandler
  • oracle.iam.identity.usermgmt.api.PasswordVerifier
  • oracle.iam.ldapsync.LDAPContainerMapper
  • oracle.iam.platform.auth.api.LoginMapper
  • oracle.iam.request.plugins.StatusChangeEvent
  • oracle.iam.identity.usermgmt.api.ReservationInLDAP
However, though all the plug-ins serves different purposes , the process for them to 'declare, or 'register' to OIM remains same.

1. Create a zip file and copy paste it to OIM_HOME/server/plugins folder
2. This zip file contains three part -
a. A lib/ folder, which holds the JAVA code in jar format
b. A META-INF folder which holds other metadata required for the plug-in. (Optional - required in case of schedulers)
c. The plug-in definition in xml format, named plugin.xml.
3. Register the pluginp.

Now, though every plugins are kept in the default OIM_HOME/server/plugins folder, you can define your own location for plugin and declare so in oim-config.xml File, as below  :



Pre-populate plug-ins : 

Let us start with the pre-populate plugins, the purpose of this plugin to auto-populate filed values in the object form (not in the process form) , which is visible to user, and often hard-coded to avoid human-error of inserting data.
Pre-populate can only be applicable where the value is always static for each user, or different to each user based on their profile ( i.e First name) , but their certainly is no scope of human choice.

For the code, I personally like to create a master class for finding the user object for which the values are to be populated, and then sub-classes for returning each attribute.

A class returning a value must implement oracle.iam.request.plugins.PrePopulationAdapter and override the prepopulate method.

Class for finding the beneficiary - 



Class for each attributes (you can write your own logic) - 


--------------------------------------------------


The Plug-in definition xml file -



There are a few import things to pay attention to in the XML above:

The ‘xmlns‘ tag attribute must be present in the XML otherwise the plug-in is not invoked by OIM.
* this is the default nameSpace : <oimplugins xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
The pluginpoin element must be ‘oracle.iam.request.plugins.PrePopulationAdapter‘
The ‘metadata‘ tag and its child node ‘value‘. The tag ‘value‘ must contain the pairs of ‘FormName::AttributeName‘.


To Register\Unregister a plug-in:

Navigate to OIM_HOME/server/plugin_utility
Make sure your ant.properties file holds the proper OIM_HOME
  • ant -f  pluginregistration.xml register 
This will prompt for the Oracle Identity Manager username and password along with the server information and the location of the plugin zip file. Enter the complete path of the zip file location.
  • ant -f  pluginregistration.xml unregister
This will prompt for the Oracle Identity Manager username and password along with the server information and the classname of the plug-in class. Enter the classname with the complete package.


Thanks for reading !