Skip to main content

Auto Approval for Self-Register Users- OIM 11g R2

For Auto Approving the self register user we need to do below steps:
1. Create an Event handler to Prepopulate the organisation key for the users.
2. Create an auto approval policy for Request level self register users.
3. Create an auto approval policy for Operational level self register users.


Create an Event handler to Prepopulate the organisation key for the users:

Create a class to prepopulate the Organisation value. Below is the sample code to do that.

package com.oracle.oim.utility.eventhandler;
import java.io.PrintStream;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Set;
import oracle.iam.identity.exception.OrganizationManagerException;
import oracle.iam.identity.orgmgmt.api.OrganizationManager;
import oracle.iam.identity.orgmgmt.vo.Organization;
import oracle.iam.identity.usermgmt.api.UserManagerConstants;
import oracle.iam.identity.usermgmt.api.UserManagerConstants.AttributeName;
import oracle.iam.identity.usermgmt.api.UserManagerConstants.Operations;
import oracle.iam.platform.Platform;
import oracle.iam.platform.context.ContextAware;
import oracle.iam.platform.kernel.spi.PreProcessHandler;
import oracle.iam.platform.kernel.vo.AbstractGenericOrchestration;
import oracle.iam.platform.kernel.vo.BulkEventResult;
import oracle.iam.platform.kernel.vo.BulkOrchestration;
import oracle.iam.platform.kernel.vo.EventResult;
import oracle.iam.platform.kernel.vo.Orchestration;

public class CustomPrepopulateHandler
  implements PreProcessHandler
{
  private static final String ORG_NAME = "Xellerate Users";
  private static final String ORG_KEY_ATTR = "act_key";
  
  public CustomPrepopulateHandler()
  {
    UserManagerConstants i = null;
    UserManagerConstants.Operations o = null;
  }
  

  public EventResult execute(long processId, long eventId, Orchestration orchestration)
  {
    System.out.println("CustomPrepopulateHandler: Inside execute");
    EventResult result = new EventResult();
    String operation = orchestration.getOperation();
    long org_key = 0;
    

      org_key = 1;
      
      System.out.println("CustomPrepopulateHandler: Calling orchestration.addParameter with org_key= " + org_key + " and operation= " + operation);
      orchestration.addParameter(UserManagerConstants.AttributeName.USER_ORGANIZATION.getId(), Long.valueOf(org_key));
      System.out.println("CustomPrepopulateHandler: After orchestration");
    System.out.println("CustomPrepopulateHandler: Exiting the Execute funstion");
    return result;
  }
  
  public BulkEventResult execute(long l, long l1, BulkOrchestration bulkOrchestration)
  {
    return null;
  }
  
  public void compensate(long l, long l1, AbstractGenericOrchestration abstractGenericOrchestration) {}
  
  public boolean cancel(long l, long l1, AbstractGenericOrchestration abstractGenericOrchestration)
  {
    return false;
  }
  
  public void initialize(HashMap<String, String> hashMap) {}
}

PS : Above code is hard coded for Xellarate Organization. We can fetch the Orgnaization on the run time also.


Create Event-handler.xml file and put it in the META-INF folder of the plugin. Sample is as below:


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

Create Plugin.xml and put it in Parallel to META-INF folder. Sample is as below:


<?xml version="1.0" encoding="UTF-8"?>
<oimplugins xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <plugins pluginpoint="oracle.iam.platform.kernel.spi.EventHandler">
    <plugin pluginclass="com.oracle.oim.utility.eventhandler.CustomPrepopulateHandler"
        version="1.0"
        name="CustomPrepopulateHandler">
    </plugin>
   </plugins>
</oimplugins>

Create an auto approval policy for Request level self register users.

Login to Sysadmin console as administrator and create an Approval policy as below:



Create a Simple Approval Rule to trigger the Approval Policy.


Create an auto approval policy for Operation level self register users.



Login to Sysadmin console as administrator and create an Approval policy as below:



Create a Simple Approval Rule to trigger the Approval Policy.









Comments

  1. You gave me great hints for achieving organization prepopulation on self registration. Thanks :)

    ReplyDelete
  2. Really nice and definitely it will be useful for many people. Kindly keep update like this.

    Manpower Consultancy in Chennai

    Hr Consultancy in Chennai

    Recruitment Consultancy in Chennai

    ReplyDelete
  3. Would you be interested in freelancing work.

    Kindly share your contact detail

    ReplyDelete

Post a Comment

Popular posts from this blog

Adding UDF (User Defined Field) on create user page OIM 11g R2 PS1:-

    Login to Sysadmin console and create a Sandbox and activate it. Click on Form Designer and search for user form. 2.      Create a new field of desired type. 3.      Provide the Required Values for UDF creation and click save and close. UDF field will be added then publish the sand box. 4.      Login to Identity console now and create another sandbox and activate it. After sandbox is activated click on users link and the click on create user. 5.      Provide the mandatory values on the form and then click the customize button on top. Select source from the view. 6.      Select the panel where the field has to be added. Select panel form lay out click add content. Select Data component Catalog from the box. 7.      Select UserVO from the bottom. ...

OIM Tuning

Application Module tuning is a critical setting which will affect the UI performance. Following are the recommended application module settings for OIM and these are already set out-of-box (OOB) in later releases of OIM 11g R2. Ensure that these settings are implemented as recommended in your environment. -Djbo.ampool.doampooling=true -Djbo.ampool.minavailablesize=1 -Djbo.ampool.maxavailablesize=120 -Djbo.recyclethreshold=60 - Djbo.ampool.timetolive=-1 -Djbo.load.components.lazily=true - Djbo.doconnectionpooling=true -Djbo.txn.disconnect_level=1 - Djbo.connectfailover=false -Djbo.max.cursors=5 - Doracle.jdbc.implicitStatementCacheSize=5 - Doracle.jdbc.maxCachedBufferSize=19 open DOMAIN_HOME/bin/setDomainEnv.sh file for the WebLogic Server instance.find these lines: JAVA_OPTIONS="${JAVA_OPTIONS}" export JAVA_OPTIONS and change it to: JAVA_OPTIONS="-Djbo.ampool.doampooling=true -Djbo.ampool.minavailablesize=1 -Djbo.ampool.maxavailablesize=120 -D...

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...