Posts

Showing posts with the label OIM

Export full MDS in OIM using WLST Command

1. Create a folder where we want to export all existing MDS files (Ex. /opt/apps/oracle/MDS Backup/) 2. Navigate to OIM_ORACLE_HOME/common/bin (ex: /opt/apps/oracle/Oracle/Middleware/Oracle_IDM/common/bin) folder and execute below commands a. ./wlst.sh b. connect() (Enter weblogic credentials when prompted. Note: provide actual hostnames wherever necessary t3://HOSTNAME:7001 ) c. exportMetadata(application='OIMMetadata', server='oim_server', toLocation='/opt/apps/oracle/MDS Backup/’) (Note: Make sure application, server details are according to document Make sure location is referred to the one which was created in step 1)

Creating JDBC connection to Oracle Database using Java code

Below is the java code to create connection to database External Jar required: ojdbc6-11.2.0.3.jar  public Connection getJDBConnection(){         String methodName = "getJDBConnection";         logger.setMethodStartLog(className, methodName);               String jdbcDriver = "oracle.jdbc.OracleDriver";         String dbUrl = "jdbc:oracle:thin:@HOSTNAME:1521:IDMDEV1";         String username = "USERNAME";         String password = "PASSWORD";         try { Class.forName(jdbcDriver); jdbcConnection = DriverManager.getConnection(dbUrl,username,password); } catch (ClassNotFoundException | SQLException e) { e.printStackTrace(); }                   logger.setMethodFinishLog(className, methodName);         return jdbcC...

How to develop a Scheduler in OIM

Image
Below steps help us in developing a new Scheduler in OIM 11G R2 PS3. Create a new Java project in Eclipse and add external jars from design console(you can add whatever Jars required for your scheduler) Create a new class which extends oracle.iam.scheduler.vo.TaskSupport as super class Write your business logic in Execute method Below is the basic structure of the Scheduler package com.ghr; import java.util.HashMap; import oracle.iam.scheduler.vo.TaskSupport; public class UpdateTCADRemovalDate extends TaskSupport { @Override public void execute(HashMap taskparams) throws Exception { // TODO Auto-generated method stub } @Override public HashMap getAttributes() { // TODO Auto-generated method stub return null; } @Override public void setAttributes() { // TODO Auto-generated method stub } } 3. Reading Task input parameters All the task input parameters available in taskparams variable which is of...

Steps to Register and un-register the plugin in OIM

Image
Steps to Register and un-register the plugin in OIM Plugin is zip file should have below structure Copy the plugin(Zip file) to server location 1) go to the path /opt/apps/oracle/ Oracle/Middleware/Oracle_IDM /server/plugins copy the zip file in this path through winSCP. 2) login to putty and go the path    cd /opt/apps/oracle/ Oracle/Middleware/Oracle_IDM/ server/plugin_utility 3) Run below command ant -f pluginregistration.xml register (for un-register ---    ant -f pluginregistration.xml  unregister ) provide xelsysadm user name and password hostname: t3://HOSTNAME:14000 plugin file path: Example:(in WinScp select file and Ctl+alt+C will give complete path)  /opt/apps/oracle/Oracle/Middleware/Oracle_IDM/server/plugins/UpdateTCADRemovalDate.zip 4)Go to the path cd /opt/apps/oracle /Oracle/Middleware/Oracle_IDM/ server/bin  and purge it by typing below command ./PurgeCache.sh All provide xels...

Custom Column in Request Track page in OIM using Backing Bean

Image
In this post lets understand how to create custom column in Request track page End result looks like below: Create backing bean using ADF Project and deploy to oim server via starter pack( create a jar of your ADF project and copy the jar to starter pack and deploy to server. reference link Deployment of starter pack ) #{backingBeanScope.RequesterUserNameInRequestTrackPage.requesterUserName} Backing bean code is as below : the below code returns you the requester user login /** * Class   : RequesterUserNameInRequestTrackPage *  Description: This class loads the requester user loginin Requester track page  * @author Ravi Kumar * Created on @date 25th July , 2018 * All rights reserved. */ /**  * Revision History-- Rev.No--- modified by--- Date--- Modified Description --- Comments if any  * ----------------------------------------------------------------------------------------------  *   * ----------...

User Login Search from user key in OIM using UserManager API

    @SuppressWarnings({ "unchecked", "rawtypes" })     public String getUserLogin(String userKey) {           String methodName = "getUserLogin";           logger.setMethodStartLog(className, methodName);           logger.debug(className, methodName, "userKey: "+userKey);           String userLogin = null;              SearchCriteria sc = new SearchCriteria("usr_key", userKey,Operator.EQUAL);            try {               Set retAttrs = new HashSet();               retAttrs.add("User Login");// add whatever fields you want get                     UserManager usrMgr = Platform.getService(UserManager.class);      //UserManager usrMgr = OIMClientFactory.g...

Submit OIM Request using API code

package com.ravikumar.ghr; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; import org.apache.log4j.Logger; import oracle.iam.platform.OIMClient; import oracle.iam.request.api.RequestService; import oracle.iam.request.vo.Beneficiary; import oracle.iam.request.vo.RequestBeneficiaryEntity; import oracle.iam.request.vo.RequestConstants; import oracle.iam.request.vo.RequestData; import ts.idm.common.utils.CustomOIMClient; import ts.idm.selfservicebulkrolemembershipoperations.model.RoleMembershipBean; public class CustomRequest { public static boolean submitCustomRequest(String requesterUserLogin,String beneficiaryUserKey, String roleName, String roleKey) { Logger logger = Logger.getLogger(CustomRequest.class); logger.debug("-------- processMembershipOperation started ---------"); logger.debug("requesterUserLogin: " + requesterUserLogin); logger.info("requesterUserLogin: " + requesterUserLogin...

Getting USR_KEY using User login

public static String getUserKey(String userLogin) { Logger logger = Logger.getLogger(UserDetail.class); logger.debug("---- getUserKey started ----"); logger.debug("userLogin: " + userLogin); String userKey = null; @SuppressWarnings("rawtypes") Map searchFilter = new HashMap<String, String>(); tcResultSet tcresultSet = null; tcUserOperationsIntf userOperationsIntf = null; OIMClient client = null; if (userLogin != null) { userLogin = userLogin.trim(); } searchFilter.put("Users.User ID", userLogin); try { CustomOIMClient c = new CustomOIMClient(); client = c.getAdminConnection();// check  post  to use local code for OIMClient connection logger.debug("Connected to OIM Client"); userOperationsIntf = client.getService(tcUserOperationsIntf.class); tcresultSet = userOperationsIntf.findAllUsers(searchFilter); if (tcresultSet != null) { userKey = tcresultSet.getStr...

Local OIM Client Connection code

public OIMClient getAdminConnection() { logger.debug("--- getAdminConnection started ----"); OIMClient oimClient = null; try { System.setProperty("java.security.auth.login.config", ABS_PATH_TO_authwl.conf_IN_DESIGN_CONSOLE); System.setProperty("APPSERVER_TYPE", "wls"); Hashtable<String, String> env = new Hashtable<String, String>(); env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL, "weblogic.jndi.WLInitialContextFactory"); env.put(OIMClient.JAVA_NAMING_PROVIDER_URL, "t3://HOSTNAME:14000"); oimClient = new OIMClient(env); logger.debug("Establishing OIM connection"); oimClient.login(ADMIN_USER_LOGIN, ADMINPASSWORD.toCharArray()); logger.debug("OIM connection established"); } catch (LoginException e) { e.printStackTrace(); } logger.debug("--- getAdminConnection completed ----"); return oimClient; }

Useful OIM Queries and tables in 11G R2 PS3

1. ORG_USER_MEMBERSHIPS --- Users Organizations details The below query give the list of users belongs to organization XXXXX select USR_LOGIN,USR_DISPLAY_NAME,ACT_NAME as "ORGANIZATION" from ORG_USER_MEMBERSHIPS,usr,act where ORG_USER_MEMBERSHIPS.act_key = act.act_key and usr.usr_key =ORG_USER_MEMBERSHIPS.usr_key and ACT_NAME = 'XXXXX' order by ACT_NAME desc; 2. USR -  User and Users Manager login in single query select u.USR_KEY,u.USR_LOGIN,u.USR_DISPLAY_NAME, u1.USR_KEY as "Manager USR_KEY",u1.USR_LOGIN as "Manager Login",u1.USR_DISPLAY_NAME as "Manager DisplayName" from usr u join usr u1 on u1.USR_KEY = u.USR_MANAGER_KEY --where u.usr_login ='XXXX'; for XXXX user manager details 3. USR -- The below query gives you list of users whose manager is XXXXXXX select u1.USR_KEY,u1.USR_LOGIN,u1.USR_DISPLAY_NAME,u.USR_KEY as "Manager Key",u.USR_LOGIN as "Manager Login",u.USR_DISPLAY_NAME as ...

Query to Join on the same table

Below query helps us in getting User login and Manager login in single query Basically in OIM USR table we have user user key, user login and manager key fields, so if we want User login and Manager login in the single query we can use below query. select u.USR_KEY,u.USR_LOGIN,u.USR_DISPLAY_NAME, u1.USR_KEY as "Manager USR_KEY",u1.USR_LOGIN as "Manager Login",u1.USR_DISPLAY_NAME as "Manager DisplayName" from usr u join usr u1 on u1.USR_KEY = u.USR_MANAGER_KEY --where u.usr_login ='User login  Id';

Setting up Pending Approvals View for Approvals Tasks in OIM

Image
Sometimes Approval tasks lists in Inbox instead of Pending Approvals view. This is because when we add a new approval human task into the composite, we have to define where this task should list; if we miss this configuration the task by default will be listed in Inbox. In this post we will learn how to configure the task to list in Pending approvals. 1. Login to http://hostname:8001/integration/worklistapp/  with weblogic credentials 2. Select PENDING_APPROVALS_VIEW and click on Edit(Pencil) in the left panel 3. Select the tasks[use control key to select multiple human tasks] 4. Click on OK to save the settings. Create new request to check tasks in Pending Approvals View.

Deployment of starter pack in OIM

Basically starter pack contains ADF customizations, you can find starter pack in the below location ../Oracle_HOME/server/apps Create / update your ADF project according to your requirement and build a jar. copy './Oracle_HOME/server/apps/server/apps/oracle.iam.ui.custom-dev-starter-pack.war' starter pack to your local machine Unzip using below command in command prompt jar -xvf oracle.iam.ui.custom-dev-starter-pack.war add your jar file to WEB-INF\lib\ zip to starter pack[home directory ie where your extracted war file, delete original file in the home directory] jar -cvf oracle.iam.ui.custom-dev-starter-pack.war * copy to the below location ./Oracle_HOME/server/apps Restart the OIM server

Setting session timeout OIM 11G R2 PS3

This article will show you how to change session timeout  for the Identity Self Service and Identity System Administration pages. The instructions I followed to change the session timeout are below Shut down all servers Modify $ORACLE_HOME/server/apps: oracle.iam.console.identity.self-service.ear oracle.iam.console.identity.sysadmin.ear It is highly recommended to back up these files. Copy these files to local machine and edit using 7zip Within these ear files only the web.xml needs to be modified. Given below is the full path to the web.xml: oracle.iam.console.identity.self-service.ear/oracle.iam.console.identity.self-service.war/WEB-INF/web.xml oracle.iam.console.identity.sysadmin.ear/oracle.iam.console.identity.sysadmin.war/WEB-INF/web.xml For both web.xml files, search for the session-timeout tag and place your desired value. The unit is in minutes. <session-config>     <session-timeo...

Decryption of OIM Password in 11GR2PS3

The below code is used to decrypt the user password in OIM 11GR2PS3. I tried to decrypt using standalone code in JDeveloper and came to know its not possible using standalone code. So please create a scheduler to decrypt the password. package com.ghr; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.HashMap; import oracle.iam.platform.Platform; import oracle.iam.scheduler.vo.TaskSupport; import tc.idm.common.utils.TSLogger; import com.thortech.xl.crypto.*; public class DecryptOIMUserPassword extends TaskSupport {     public static final String TS_SCHEDULER_LOGGER = "TC.SCHEDULER";     TSLogger logger = new TSLogger(TS_SCHEDULER_LOGGER);     private String className = this.getClass().getName();          public void execute(HashMap taskParams) throws Exception {         String methodName = "execute"; ...

Clean restart of OIM Servers

I personally recommend below steps/order to restart complete OIM stack servers. Shut down servers( follow below order) BIP Server SOA Server OIM Server You can stop servers using weblogic console or using below commands in the below path cd /opt/apps/oracle/Oracle/Middleware/user_projects/domains/weblogic/bin 1. BIP Server nohup ./stopManagedWebLogic.sh bi_server > bi_server.log & 2. SOA Server nohup ./stopManagedWebLogic.sh soa_server > soa_server.log & 3. OIM Server nohup ./stopManagedWebLogic.sh oim_server > oimserver.log & 4. Admin Server nohup ./stopWeblogic.sh & Delete tmp and cache in bi/soa/oim servers Remove content in the below directories /opt/apps/oracle/Oracle/Middleware/user_projects/domains/weblogic/servers/***_server/tmp/ /opt/apps/oracle/Oracle/Middleware/user_projects/domains/weblogic/servers/***_server/cache/ rm -rf * Starting servers Start Order 1. Start Admin ...