Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

Lab 4: Customized On-boarding of Contractors using Event

Handlers

Contents
Lab 4: Customized On-boarding of Contractors using Event Handlers .......................................................... 1

1. Introduction ............................................................................................................................................. 1

2. Content ..................................................................................................................................................... 2

2.1 Prerequisites for the sample ............................................................................................................. 2


2.2 Build & Deploy the sample ............................................................................................................. 24
2.3 Post deployment Unit testing Procedure ...................................................................................... 29
2.3.1 Test the Contractor on-boarding (event handler) via UI. .................................................. 29
2.3.2 Test the Contractor on-boarding (event handler) via Reconciliation. .............................. 34

1. Introduction

If the employee is a Contractor, they must be registered in the Contractor Registration System, which is an external application. This application is
a database application. The database has the following structure
User ID Contractor ID First Name Last Name

After successful registration, their Contractor ID must be retrieved and updated in their OIM User Profile.
OIM 11g Workshop - Lab 3

This use-case will be developed as a plug-in and deployed on Oracle Identity Manager 11g environment.
The plug-in will be used for extracting “Contractor Id” or any configured column name from specified database table and update OIM User profile.
This event handler will be implemented as PostProcessHandler and registered for Create operation of User. It will be a conditional event handler,
executing for only "contractor" users. If the user type is Contractor then it will connect the external application to retrieve the Contractor Id (field
is defined in DB.table.column.to.retrieve) based on the OIM user id (defined in DB.Matching.OIM.User.Field) and updated the OIM User profile
with contractor Id.

2. Content

2.1 Prerequisites for the sample


Database table ”Contractor” having the below table structure is already created in the VM.

Column Name Data type


User ID varchar2(256) primary key
Contractor ID varchar2(256)
First Name varchar2(256)
Last Name varchar2(256)

Import “ContractorIDConfiguration.xml” file located at “oim_objects/” in the package, which will be available in
/odrive/dummydata/Lab 4/ContractorIDEventHandlerPostProc.zip. It will create the following configurations
which will be used by the event handler.
 lookup.externalDatabase.configuration
 Custom Attribute “Contractor Id”

To import the above file into OIM login to the advanced console of OIM and click on Import Deployment Manager File as shown below

2
OIM 11g Workshop - Lab 3

Create the required Authorization Policy for the attribute “Contractor Id”. Create a new Authorization policy, add permissions as
“View User Details” (All attributes) and “Modify User Profile” (attribute “Contractor Id”), and add “System Administrators” role as the
assignee.

1. Create Authorization policy for Contractor ID attribute

4
2. set view user details permission and select all.
OIM 11g Workshop - Lab 3

3. set Modify user profile permission and select Contracto Id attribute. click save

4. In data Constraints section , select All Users

6
5. In Policy Assignment , select SYSTEM ADMINISTRATOR role
OIM 11g Workshop - Lab 3

8
6. View policy confirmation page and click finish
OIM 11g Workshop - Lab 3

7. Click Apply.

Connectivity parameters to the Contractor database (table) are stored in an IT resource. To create this IT resource from OIM web
console follow the steps below

10
OIM 11g Workshop - Lab 3

1. Provide the information given in the table below. Please note that the IT Resource Type must be selected as Database.

IT Resource Name ExternalContractorDatabase


IT Resource Type Database

2. Click on “Continue”

12
3. Specify IT Resource Parameter Values for desired database
DatabaseName idm11gdb
Driver oracle.jdbc.OracleDriver
Password abcd1234
URL jdbc:oracle:thin:@//orclfmw.example.com:1521/idm11gdb
UserID fetrng3_oim
OIM 11g Workshop - Lab 3

4. Click on “Continue”

14
5. Set Access Permission to IT Resource and then click on “Continue”
OIM 11g Workshop - Lab 3

6. Verify IT Resource Details and click on “Continue”

16
7. Click on create on below window
OIM 11g Workshop - Lab 3

8. Click on Finish

18
Contractor on-boarding process would use a flat file as a source of identities. In order to do so, a flat file Generic Connector named
“HR_FILE_GTC_CONNECTOR” is already created in the VM.

The current event handler has been developed considering a highly configurable design. Therefore, a lookup code has been
introduced so that developers can tweak values of various parameters and change the behavior. By default, they have the optimum
default values to make the event handler work as per the environment set in the VM. To find out more details on what can be
customized and configured better to your needs (and only if that is required), navigate to design console and check the lookup code
“lookup.externalDatabase.configuration” which would have been already created by the DM file import.
OIM 11g Workshop - Lab 3

1. Launch Design console and login with xelsysadm/Abcd1234.

2. Select “Administration” -> “Lookup Definition”

20
3. Enter “lookup.externalDatabase.configuration” and then click on search query/ binoculars in the menu bar.
OIM 11g Workshop - Lab 3

4. Following search result will be displayed

22
5. Follow the description below to understand how these parameters could be tweaked. By default, they have the optimum
default values to make the event handler work as per the environment set in the VM.

Code Key Decode Information


OIM 11g Workshop - Lab 3

DB.Matching.OIM.User.Field UserID The OIM user field. This field


value will be used to find
matching record in DB column
defined in the LKU key
DB.table.column.to.retrieve
DB.ITResource DBResource The DB table name. This table
will be used to retrieve column
value defined in LKU:
DB.table.field.to.retrieve
DB.Table.Name Contractor The DB table name. This table
will be used to retrieve column
value defined in LKU:
DB.table.field.to.retrieve
DB.Table.Column.To.Retrieve ContractorID The DB column name. This
column name will be used to
retrieve value from table defined
in LKU key : DB.table.name
OIM.User.Field.To.Update Contractor Id The OIM User field. This field value
will be updated with
corresponding DB table field value.
OIM.UserType.Event.Identifier Contractor The user type identifier. This must
be same as OIM User Type as it will
be used to match OIM User Type
during the execution of event
handler.

2.2 Build & Deploy the sample


1. Open ContractorIDEventHandlerPostProc.jpr in JDeveloper, which will be available in /odrive/dummydata/Lab 4…
2. Please make sure you have OIM Customization Installer extension installed on this JDeveloper instance.
3. Open ContractorIDEventHandlerPostProc.jpr in JDeveloper.
4. Right click the project and click on Project Properties from the context menu.
24
5. Go to Libraries and Classpath section.
OIM 11g Workshop - Lab 3

6. Add oimclient.jar file to the classpath.

26
7. Oimclient.jar is successfully added to the project.
OIM 11g Workshop - Lab 3

8. Select the project (ContractorIDEventHandlerPostProc) in the Application Navigator.


9. Go to “Tools” -> OIM Customization Installer->Deploy.

28
2.3 Post deployment Unit testing Procedure
Once the steps mentioned in "Deployment Procedure" are followed, the sample can be
Run against an existing OIM installation on the same host.

2.3.1 Test the Contractor on-boarding (event handler) via UI.


1. Open OIM console and create new user of type “Contractor”.
2. Go to “Administration”.
OIM 11g Workshop - Lab 3

30
3. Click on “Create User”
OIM 11g Workshop - Lab 3

32
4. Fill the User details and then click on Save

5. Search for user that was created.

6. Click on the User from the search result, the Contractor ID gets updated in the user profile.
OIM 11g Workshop - Lab 3

2.3.2 Test the Contractor on-boarding (event handler) via Reconciliation.

1. Login to the OIM “Advanced” console and click on “Search Scheduled Jobs”.

34
2. Search for the scheduled job created while creating the generic connector. Enter the name of scheduled job as
HR_FILE_GTC_CONNECTOR_GTC in the text box and click on the search arrow button as shown below.
OIM 11g Workshop - Lab 3

3. Click on the schedule job from the search result and then click on “Run Now”.

36
4. After clicking the Run Now below screen appears.
OIM 11g Workshop - Lab 3

5. Click on the “Refresh” button.

38
6. Below screen appears.
OIM 11g Workshop - Lab 3

7. Search for any one user that was present in the flat file.

40
8. Click on the User from the search result, the Contractor ID gets updated in the user profile.
OIM 11g Workshop - Lab 3

42

You might also like