Enabling a User through OIM API

Hi I am trying to enable a user through OIM API, However the end date is already passed for that user, I am setting up a new end date through the Program (showm below). However the update user is not working (i am not sure).
Map usermap = new HashMap();
usermap.put("Users.User ID", User_id );
Map grpmap = new HashMap();
grpmap.put("Groups.Group Name", Group_Name);
tcResultSet ts = userClient.findUsers(usermap); //find all users
String existing_end_date = ts.getStringValue("Users.End Date");
tcResultSet tg = groupClient.findGroups(grpmap); //find requireq group
long ukey = ts.getLongValue("Users.Key");
long gkey = tg.getLongValue("Groups.Key"); //find group key
// ENABLE THE USER
java.util.Date new_end_date = new java.util.Date(111,1,1);
Calendar cal = Calendar.getInstance();
cal.setTime(new_end_date);
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String Str1 = dateFormat.format(cal.getTime());
String Str2 = existing_end_date + " 12:00:00";
System.out.println(User_id+" OLD End Date:" + Str2 + " New End Date: " + Str1);
Map usermap2 = new HashMap();
usermap2.put("Users.User ID", User_id );
usermap2.put("Users.End Date", Str1);
userClient.updateUser(ts,usermap2);
userClient.enableUser(ukey);
I am getting the following error:
U0000018 OLD End Date:2009-09-30 12:00:00 New End Date: 2011-02-01 12:00:00
2/12/2010 15:02:53 oracle.j2ee.rmi.RMIMessages EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER
WARNING: Exception returned by remote server: {0}
Thor.API.Exceptions.tcAPIException: The user cannot be enabled because the end date is passed.
Not sure why it is happening. It looks like the Updateuser is not working, or something else?
Please advise. Thanks in advance.

Hi Suren,
thanks for the note.
I found that as soon as I enable the user, I am getting the followimg messages in the opmn logs:
INFO,06 Dec 2010 10:55:41,841,[XELLERATE.JAVACLIENT],System Event Handler: Validating Organization for an User.
INFO,06 Dec 2010 10:55:41,944,[XELLERATE.JAVACLIENT],System Event Handler: Triggering Processes related to User.
INFO,06 Dec 2010 10:55:42,402,[XELLERATE.JAVACLIENT],System Event Handler: Enabling the User
INFO,06 Dec 2010 10:55:42,421,[XELLERATE.JAVACLIENT],System Event Handler: Validating Organization for an User.
INFO,06 Dec 2010 10:55:42,427,[XELLERATE.JAVACLIENT],System Event Handler: Triggering Processes related to User.
INFO,06 Dec 2010 10:55:42,439,[XELLERATE.JAVACLIENT],System Event Handler: Changing application data based on Organization change.
INFO,06 Dec 2010 10:55:42,442,[XELLERATE.JAVACLIENT],System Event Handler: Auto-Group Membership Event.
INFO,06 Dec 2010 10:55:43,715,[XELLERATE.JAVACLIENT],System Event Handler: Evaluating User Policies
So, the access policies are getting evaluated, triggering provisioning processes.
What I am planning to do is, to disable the access policies and try to run the Program.
Because of this issue, my Program is throwing an error (until I looked into the opmn logs, it doesn't make sense).
6/12/2010 10:55:50 oracle.j2ee.rmi.RMIMessages EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER
WARNING: Exception returned by remote server: {0}
Thor.API.Exceptions.tcAPIException: Error occurred enabling Xellerate User instance.
Regards
Vijay Chinnasamy

Similar Messages

  • How to assign AdminRole to user through OIM API

    Hi all,
    Can any one tell me which method I have to use to assign a AdminRole to user using OIM API..
    Thanks in Advance

    Hi karthik thanks for the link...
    it is throwing the following error
    Exception in thread "main" oracle.iam.platform.utils.NoSuchServiceException: java.lang.ClassNotFoundException: oracle.iam.platform.authopss.api.AdminRoleServiceDelegate
    can i know which jar file to add for this error
    thanks in advance

  • Provisioning OIM user using OIM APIS

    Hi All,
    Could anyone help me out on how to provision a User using OIM APIS.
    Thanks and Regards,
    Vaasu.

    public class GetGroups {
    tcUtilityFactory utilFactory = null;
    tcSignatureMessage moSignature = null;
    tcUserOperationsIntf moUserUtility = null;
    tcResultSet userResultSet,userSet = null;
    ConfigurationClient.ComplexSetting myConfig = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    final Hashtable env = myConfig.getAllSettings();
    Map v = new HashMap();
    public void UserGroups(String userid) {
    try {
    System.out.println(" I am in TRY");
    moSignature = tcCryptoUtil.sign("xelsysadm", "PrivateKey");
    utilFactory = new tcUtilityFactory(env, moSignature);
    moUserUtility =
    (tcUserOperationsIntf) utilFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
    v.put("Users.User ID", userid);
    userSet = moUserUtility.findAllUsers(v);
    long user_key = userSet.getLongValue("Users.Key");
    System.out.println( " Group Name " + grpName );
    } catch(Exception e){
    e.getMessage();
    Like that
    moobjIntf =
    *(tcObjectOperationsIntf) utilFactory.getUtility("Thor.API.Operations.tcObjectOperationsIntf");*
    Map objmap =new HashMap(0;
    objmap.put("Objects.Name", "AD User") \\ just hardcoding this AD User you can pass it as variable also
    tcResultSet moResultSet = moobjIntf.findObjects(objmap);
    long obj_key = moResultSet.getLongValue("Objects.Key");

  • Assigning roles to LDAP users through BIP API

    Hi.
    My customer has BIP 11g and OIM 9.1.0.2 running on the same weblogic server (11g). Both authenticate against the same LDAP server.
    One of our desired next steps is to provision from OIM the BIP roles to each LDAP user so every user gets the correct roles (and access to the correct reports) according to the groups he has on OIM.
    I've been searching for info regarding this without success. The BIP API doc does not show any info about assigning roles to users.
    We don't need to manage LDAP users, BIP roles, etc... through OIM. We only need to assign BIP roles to LDAP users.
    Is it possible to make that assignments through BIP API?
    If not, any other ideas? New ideas or different approaches are welcome.
    Thanks in advance.

    In OBIEE 11g which includes BIP the application roles are applied to LDAP users and groups using the Enterprise Manager Fusion Control.
    During the upgrade process from OBIEE 10g to OBIEE 11g the groups do get assigned to these roles transparently so there must be some API to leverage this functionality.
    I would start there, http://download.oracle.com/docs/cd/E14571_01/bi.1111/e10541/admin_api.htm
    There are no specific instructions on accomplishing what you seek but if you have some WLST or Java Skills you should be able to get something prototyped.
    Let me know if that helps.

  • How to create a Connection to UDB Database through OIM APIs.?

    Hi,
    In our OIM (9.1.0.2) implementation, there is a need to connect to a UDB database to execute some select queries and get the data. Is there any way in which I can do this?
    I tried creating an ITResource to have all static database related information, but I was not able to use that ITResource and create an actual database connection in the java code.
    As far as possible, I don't want to use any JDBC code to create the connection but want to know if there are any inbuilt OIM APIs which can help me in creating a database connection to point to the UDB database.
    (We don't have the DBUM connector deployed.)
    Please get back with your views/info on this.
    Thanks,
    Kulesh...

    Here is a constructor code for connecting to a database:
         public DatabaseConnection(String hostname, String port, String driver, String sid, String admin, String password) throws ClassNotFoundException, SQLException{
              log.info(CLASS_NAME + " -----> inputs=hostname[" + hostname +
                        "]port[" + port +
                        "]driver[" + driver +
                        "]sid[" + sid +
                        "]admin[" + admin +
                        "]password[********]");
              Properties connectionProps=new Properties();
         connectionProps.setProperty("user", admin);
         connectionProps.setProperty("password", password);     
         String url = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=" + hostname +
              ")(PORT=" + port +
              "))(CONNECT_DATA=(SID=" + sid + ")))";
         Class.forName(driver);
              con = null;     
         con = DriverManager.getConnection(url, connectionProps);
    If you want to use SSL, you will want to configure tcps for jdbc connection to the database, or any other form of connection and update your URL string for it.
    -Kevin

  • Unlocking OID User Through OIM

    Hi all,
    I am testing an OID User Process task in OIM which can be run on a user's OIM account and unlock a locked user in OID
    However, I am getting the following error after executing the task:
    ERROR 11:54:51,375, RMICallHandler-113 XL_INTG.OID - ====================================================
    ERROR 11:54:51,376, RMICallHandler-113 XL_INTG.OID - ERROR in OID:com.thortech.xl.integration.OID.util.tcUtilLDAPOperations:modifyAttributesReplace(S,A) NamingExceptionUnable to add attributes of the object
    ERROR 11:54:51,376, RMICallHandler-113 XL_INTG.OID - ====================================================
    ERROR 11:54:51,376, RMICallHandler-113 XL_INTG.OID - ====================================================
    ERROR 11:54:51,376, RMICallHandler-113 XL_INTG.OID - [LDAP: error code 53 - Account Policy Error :9051: GSL_ACCOUNTUNLOCK_EXCP : Only Modify-add allowed on orclpwdaccountunlock attribute. Modify-delete and Modify-replace are not allowed.
    ERROR 11:54:51,376, RMICallHandler-113 XL_INTG.OID - ====================================================
    ERROR 11:54:51,377, RMICallHandler-113 XL_INTG.OID - ====================================================
    ERROR 11:54:51,377, RMICallHandler-113 XL_INTG.OID - ERROR in com.thortech.xl.integration.OID.tcUtilOIDUserOperations:modifyUser(S,S,S,S) NamingExceptionError while connecting to target
    ERROR 11:54:51,377, RMICallHandler-113 XL_INTG.OID - ====================================================
    ERROR 11:54:51,377, RMICallHandler-113 XL_INTG.OID - ====================================================
    ERROR 11:54:51,377, RMICallHandler-113 XL_INTG.OID - com.thortech.xl.integration.OID.util.tcUtilLDAPOperationsNamingException[LDAP: error code 53 - Account Policy Error :9051: GSL_ACCOUNTUNLOCK_EXCP : Only Modify-add allowed on orclpwdaccountunlock attribute. Modify-delete and Modify-replace are not allowed.
    ERROR 11:54:51,378, RMICallHandler-113 XL_INTG.OID - ====================================================
    ERROR 11:54:51,378, RMICallHandler-113 XL_INTG.OID - ====================================================
    ERROR 11:54:51,378, RMICallHandler-113 XL_INTG.OID - com.thortech.xl.integration.OID.util.tcUtilLDAPOperationsNamingException[LDAP: error code 53 - Account Policy Error :9051: GSL_ACCOUNTUNLOCK_EXCP : Only Modify-add allowed on orclpwdaccountunlock attribute. Modify-delete and Modify-replace are not allowed.
    ERROR 11:54:51,378, RMICallHandler-113 XL_INTG.OID - ====================================================
    DEBUG 11:54:51,378, RMICallHandler-113 XL_INTG.OID - com.thortech.xl.integration.OID.tcUtilOIDUserOperations:modifyUser(S,S,S,S) Returning with code: INVALID_NAMING_ERROR
    I am using the adapter adpOIDMODIFYUSER to update the orclpwdaccountunlock attribute to 1.
    Not sure if this is a correct method. Any ideas would be appreciated :)

    Bbagaria: OIDDAS is not enabled in our environment. However, I can unlock the user in OID using ldapmodify
    ldapmodify -p 636 -h **** -D "cn=orcladmin" -w *** -v -f /home/oracle/unlock.ldif
    dn: cn=JENZO,ou=***,dc=***,dc=***,dc=***
    changetype: modify
    add: orclpwdaccountunlock
    orclpwdaccountunlock: 1
    Rajiv: I did try that. Same results unfortunately.

  • Error while Enabling a user in OIM

    Hi,
    I have a requirement where i need to disable and enable OIM users based on a UDF . If the UDF says Active user should be enabled and if it says "deleted" user should be disabled. I'm able to "Disable" a user present in "Active" state but not vice versa. My entity adapter is as follows
    statusUpdate(String userKey,String Status){
              OIMConnectionManagerImpl oimConn = new OIMConnectionManagerImpl();
              tcUserOperationsIntf tcUser = oimConn.getUserAPI();
              tcResultSet tcres = null;
                   HashMap map = new HashMap();
                   map.put("Users.Key",userKey);                    
                   tcres = tcUser.findUsers(map);
                   String s1=tcres.getStringValue("Users.Status");
                   if(Status.equalsIgnoreCase("Active") )
                        if(s1.equalsIgnoreCase("Disabled")){
                             tcUser.enableUser(Long.parseLong(userKey));
                   if(Status.equalsIgnoreCase("Deleted") )
                        if(s1.equalsIgnoreCase("Active")){
                             tcUser.disableUser(Long.parseLong(userKey));
    My error is as follows
    [com.oim.util.OIMConnectionManagerImpl] Unable to create factory instance
    java.lang.NullPointerException
    Edited by: user10665408 on Jul 1, 2009 3:14 PM

    I have done sm changes now:
    Try this.
    If some import is missing or some spelling mistakes are there just correct those. It's just for reference.
    Put import for map also.
    package com.Tst.oim;
    import Thor.API.Operations.tcUserOperationsIntf;
    import Thor.API.tcResultSet;
    import Thor.API.tcUtilityFactory;
    import com.thortech.xl.crypto.tcCryptoUtil;
    import com.thortech.xl.crypto.tcSignatureMessage;
    import com.thortech.xl.util.config.ConfigurationClient;
    import java.util.Hashtable;
    public class CreateFile {
    tcUtilityFactory utilFactory = null;
    tcSignatureMessage moSignature = null;
    tcUserOperationsIntf moUserUtility = null;
    tcResultSet userResultSet = null;
    ConfigurationClient.ComplexSetting myConfig =
    ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    final Hashtable env = myConfig.getAllSettings();
    public void Enable(String userid) {
    try {
    System.out.println("TRY");
    moSignature = tcCryptoUtil.sign("xelsysadm", "PrivateKey");
    utilFactory = new tcUtilityFactory(env, moSignature);
    moUserUtility = (tcuserOperations)utilfactory.getutility("Thor.API.Operations.tcUserOperations");
    Map a = new HashMap();
    a.put("Users.User ID", userid);
    tcResultSet userset = moUserUtility.findAllUsers(a);
    long ukey = userset.getLongValue("Users.Key");
    moUserUtility.enableuser(ukey);
    } catch (Exception e) {
    e.printStackTrace();
    Edited by: Dost

  • TcObjectNotFoundException Error when provisioning through OIM API

    Hi,
    I am trying to provision resources using OIM client API. I am using the following code which is generating the exception mentioned after the code snippet:
    *******************************Code*******************************
    java.util.Hashtable env = new java.util.Hashtable();     
      env.put(oracle.iam.platform.OIMClient.JAVA_NAMING_FACTORY_INITIAL,     
      oimInitialContextFactory);        
      env.put(oracle.iam.platform.OIMClient.JAVA_NAMING_PROVIDER_URL, oimURL);
      oracle.iam.platform.OIMClient client = new oracle.iam.platform.OIMClient(env);
    Thor.API.Operations.tcUserOperationsIntf userIntf = client.getService(Thor.API.Operations.tcUserOperationsIntf.class);
      Thor.API.Operations.tcObjectOperationsIntf objIntf = client.getService(Thor.API.Operations.tcObjectOperationsIntf.class);
      Thor.API.Operations.tcFormInstanceOperationsIntf formIntf = client.getService(Thor.API.Operations.tcFormInstanceOperationsIntf.class);
      Thor.API.Operations.tcProvisioningOperationsIntf provIntf = client.getService(Thor.API.Operations.tcProvisioningOperationsIntf.class);
      Thor.API.Operations.tcUserOperationsIntf userOper = client.getService(Thor.API.Operations.tcUserOperationsIntf.class);
      java.util.Hashtable mhSearchCriteria = new java.util.Hashtable();
    Hashtable objectHash = new Hashtable();
      objectHash.put("Objects.Name", "ITAX_GTC");
    com.thortech.xl.vo.ResourceData data = userIntf.provisionResource(Long.parseLong(userId), objectKey);
      long userObjectInstanceKey = Long.parseLong(data.getOiuKey());
      long objectInstanceKey = Long.parseLong(data.getObiKey());
        Hashtable inputHash = new Hashtable();
      //Populate the entry below with the object form data
      for(int b = 3; b < row.length; b++)
      inputHash.put(header[b], row[b]);
      //Sets the object data
      formIntf.setProcessFormData(objectInstanceKey, inputHash);
    Thor.API.Exceptions.tcObjectNotFoundException
      at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
      at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
      at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
      at Thor.API.Operations.tcUserOperationsIntf_e9jcxp_tcUserOperationsIntfRemoteImpl_1035_WLStub.revokeObjectx(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:85)
      at $Proxy2.revokeObjectx(Unknown Source)
      at Thor.API.Operations.tcUserOperationsIntfDelegate.revokeObject(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at Thor.API.Base.SecurityInvocationHandler$1.run(SecurityInvocationHandler.java:68)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.security.Security.runAs(Security.java:41)
      at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(weblogicLoginSession.java:52)
      at Thor.API.Base.SecurityInvocationHandler.invoke(SecurityInvocationHandler.java:79)
      at $Proxy3.revokeObject(Unknown Source)
      at com.infotech.tra.organization.RoleAssignment.ProvisionResources(RoleAssignment.java:1013)
      at com.infotech.tra.organization.RoleAssignment.main(RoleAssignment.java:48)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)
    Caused by: Thor.API.Exceptions.tcObjectNotFoundException
      at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.revokeObject(tcUserOperationsBean.java:3184)
      at Thor.API.Operations.tcUserOperationsIntfEJB.revokeObjectx(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
      at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
      at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
      at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
      at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
      at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      at $Proxy344.revokeObjectx(Unknown Source)
      at Thor.API.Operations.tcUserOperationsIntf_e9jcxp_tcUserOperationsIntfRemoteImpl.__WL_invoke(Unknown Source)
      at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
      at Thor.API.Operations.tcUserOperationsIntf_e9jcxp_tcUserOperationsIntfRemoteImpl.revokeObjectx(Unknown Source)
      at Thor.API.Operations.tcUserOperationsIntf_e9jcxp_tcUserOperationsIntfRemoteImpl_WLSkel.invoke(Unknown Source)
      at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
      at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
      at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
      at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
      at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

    To set the form data, you need the "Process Instance.Key" and not the object instance key.  This is the code i use and i've replaced your data with some of the entries here:
    String resource = "ITAX_GTC";
    String userID = "JSMITH";
    Map map = new HashMap();
    map.put("Objects.Name",resource);
    tcResultSet set = objIntf.findObjects(map);
    long resourceKey = set.getLongValue("Objects.Key");
    Set<String> attrNames = new HashSet<String>();
    attrNames.add(UserManagerConstants.AttributeName.USER_KEY.getId());
    HashMap searchCriteria = new HashMap();
    searchCriteria.put("Objects.Name",resource);
    int counter = 0;
    String[] users = new String[] {userID};
    for (String userID:users){
        try {
      counter++;
      User user = usermgr.getDetails(userID, attrNames, true);
      long objectInstanceKey = userIntf.provisionObject(Long.parseLong(user.getEntityId()), resourceKey);
      System.out.println("objectInstanceKey[" + objectInstanceKey + "]");
      set = provIntf.findObjects("Revoke", new String[]{ user.getEntityId() }, "U", searchCriteria);
      for (int i=0;i<set.getTotalRowCount();i++){
         set.goToRow(i);
         outputResultSet(set, i);
         if (set.getLongValue("Users-Object Instance For User.Key")==objectInstanceKey){
           map = new HashMap();
           //Populate the entry below with the object form data
             for(int b = 3; b < row.length; b++){
                map.put(header[b], row[b]);
      formIntf.setProcessFormData(set.getLongValue("Process Instance.Key"), map);
        } catch (Exception e) {
      System.out.println(e.getLocalizedMessage());
    See if that helps.
    -Kevin

  • Create a user through the API and "Prompt user to change password after next login".

    Using the Adobe Connect Interface, I can create a user and check the checkbox to "Prompt user to change password after next login".
    Can I achieve the same result using the API? The principal-update action doesn't offer such an option and, as far as I can tell, there isn't another action to do so either.
    Thank you.

    You can achieve it as part of your application functionality, but not as a configuration option on WLS.

  • Retry failed task through OIM API

    Hi everyone,
    I am trying to retry a failed task of particular resource. Can some one throw some light on how to do this?
    Thanks,
    Ani

    Assuming there is only one instance of the task for an individual user, you could do something like this:
                   tcProvisioningOperationsIntf provIntf = (tcProvisioningOperationsIntf) ioUtilityFactory.getUtility(tcProvisioningOperationsIntf.class.getName());
                   Map map = new HashMap();
                   map.put("Process Definition.Tasks.Task Name", "Rejcted Task Name");
                   map.put("Objects.Name", "Resource Object Name");
                   String[] statuses = {"Rejected"};
                   tcResultSet set = provIntf.getAssignedProvisioningTasks(1, map, statuses);
    This will return all rejected tasks, with task name, for resource object, assigned to Xelsysadm.
    9.1.0.2 also has the API
    findAllOpenProvisioningTasks
    Thor.API.tcResultSet findAllOpenProvisioningTasks(java.util.Map attributeList,
    java.lang.String[] statuses)
    throws Thor.API.Exceptions.tcAPIException,
    tcAPIException
    You could test out these options. Then task the task key from the result set and use the retryTask API.
    -Kevin
    +(Don't forget the points where deserved)+

  • Provision Resource through OIM APIS

    I am using the OIMClient and the new APIs to provision a resource
    I am using the Provisioning Service provision() method. For the Account details how should the AccountData be initialized. It says int he APIs that the AccountData constructor is only for already provisioned accounts.
    Please suggest if there is any other way this can be done.

    Try this:
    //Account profile data - need not be set if all data is coming from prepop adapters
      HashMap parentData = new HashMap();
      parentData.put("UD_ADUSER_UID","Larry.Jones");
      parentData.put("UD_ADUSER_FNAME","Larry");
      parentData.put("UD_ADUSER_LNAME","Jones");
    //Construct account data VO with process form key sdk_key=15
      AccountData objAccountData = new AccountData("15", null, parentData);
    //Construct account VO with app instance and account data VO
      Account objAccount = new Account(appInstance, objAccountData);
      //Provision the account to user with usr_key=6
      long oiuKey = provisioningService.provision("6", objAccount);

  • OIM API portablity issue  with OIM 9.1 / Weblogic 10.3

    Hi , We have a existing piece of code which does some User Mutation through OIM API.
    [I am not well versed with OIM ]
    The code was running fine with Weblogic 8.3 and previous OIM version.
    Here is the piece of code.
    logger.info("Initializing OIM Params from config location:" oimConfigFileUtil.getOIMConfigBase());+*
    +          System.setProperty("XL.HomeDir", oimConfigFileUtil.getOIMConfigBase().getAbsolutePath());+
    +          System.setProperty("java.security.auth.login.config", oimConfigFileUtil.getOIMAuthWLFile().getAbsolutePath());+
    +          ConfigurationClient.ComplexSetting configClient = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");+
    +          env = configClient.getAllSettings();+
    *+          try {+*
    +               oimAccessFactory = new tcUtilityFactory(env, oimConfigFileUtil.getUserID(), oimConfigFileUtil.getPassword());+
    I traced all the dependecy's for this piece of code.
    If I run this with Weblogic.jar[8.1] it gives me
    java.io.InvalidClassException: com.thortech.xl.dataaccess.tcDataSet; local class incompatible: stream classdesc serialVersionUID = -5446056666465114187, local class serialVersionUID = -8857647322544023100*
    With the compatablity issue I substituted with weblogic.jar:10.3 , now its giving me all classpath issues.
    Can someone layout the exact jars that are required for this to work?
    Thanks
    Vignesh

    Installl a Design Console. Copy any files that are required. Then take the class paths that are listed in the classpath and basecp files and put those into your application classpath files.
    -Kevin

  • Create new schedule task using OIM API

    Hello,
    Steps for setting up eclipse :
    1)Create a new JAVA project.
    2)Right click on your newly created JAVA project & select properties.
    3)In Properties window select JavaBuildPath & select libraries tab.
    4)Click on AddExternalJar's button & add jar files from lib,ext folders of OIM client installation.
    5)Click OK.
    CODE<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<package oimscheduler;
    import java.util.HashMap;
    import java.util.Hashtable;
    import javax.naming.Context;
    import Thor.API.Operations.tcUserOperationsIntf;
    import Thor.API.Exceptions.tcAPIException;
    import Thor.API.Exceptions.tcChallengeNotSetException;
    import Thor.API.Exceptions.tcLoginAttemptsExceededException;
    import Thor.API.Exceptions.tcPasswordResetAttemptsExceededException;
    import Thor.API.Exceptions.tcUserAccountDisabledException;
    import Thor.API.Exceptions.tcUserAccountInvalidException;
    import Thor.API.Exceptions.tcUserAlreadyLoggedInException;
    import Thor.API.tcUtilityFactory;
    import com.thortech.xl.scheduler.tasks.SchedulerBaseTask;
    import com.thortech.xl.util.config.ConfigurationClient;
    public class Scheduler extends SchedulerBaseTask
         tcUtilityFactory ioUtilityFactory = null;
         @Override
         protected void execute()
              try
                   System.out.println("Executing Scheduler.....");
                   createConnection();
                   createUser();
                   System.out.println("Back In execute fn !!!");
              catch(Exception e)
                   System.out.println("Error In execute : "+e.toString());
         public void createConnection()
              try
                   System.setProperty("XL.HomeDir","D:\\Oracle\\OIM\\xellerate");
                   System.setProperty("java.security.policy","D:\\Oracle\\OIM\\xellerate\\config\\xl.policy");
                   System.setProperty("java.security.auth.login.config","D:\\Oracle\\OIM\\xellerate\\config\\authwl.conf");
                   System.setProperty("java.naming.provider.url","t3://localhost:7001 ");
                   System.out.println("Setting Configurations .....");
                   System.out.println("Starting .....");
                   ConfigurationClient.ComplexSetting config =
                   ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
                   System.out.println("Login...");
                   Hashtable env = config.getAllSettings();
                   env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
                   env.put("java.naming.provider.url","t3://localhost:7001");
                   ioUtilityFactory = new tcUtilityFactory(env,"xelsysadm","abcd1234");
              catch(tcAPIException ae)
                   System.out.println("Error In createConnection:tcAPIException "+ae.toString());
              catch(tcChallengeNotSetException cnse)
                   System.out.println("Error In createConnection:tcChallengeNotSetException "+cnse.toString());
              catch(tcLoginAttemptsExceededException laee)
                   System.out.println("Error In createConnection:tcLoginAttemptsExceededException "+laee.toString());
              catch(tcPasswordResetAttemptsExceededException praee)
                   System.out.println("Error In createConnection:tcPasswordResetAttemptsExceededException "+praee.toString());
    catch(tcUserAccountDisabledException uade)
         System.out.println("Error In createConnection:tcUserAccountDisabledException "+uade.toString());
    catch(tcUserAccountInvalidException uaie)
         System.out.println("Error In createConnection:tcUserAccountInvalidException "+uaie.toString());
    catch(tcUserAlreadyLoggedInException uale)
         System.out.println("Error In createConnection:tcUserAlreadyLoggedInException "+uale.toString());
              catch(Exception e)
                   System.out.println("Error In createConnection:Exception "+e.toString());
         public void createUser()
              System.out.println("<<< In createUser Fn >>>");
              try
                   tcUserOperationsIntf moUserUtility = (tcUserOperationsIntf)ioUtilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
                   HashMap user = new HashMap();
                   user.put("Users.User ID","OIM-API-SCH");
                   user.put("Users.First Name","Oracle-SCH");
                   user.put("Users.Middle Name","JAVA-SCH");
                   user.put("Users.Last Name","SUN-SCH");
                   user.put("Organizations.Key","1");
                   user.put("Users.Role","Full-Time");
                   user.put("Users.Xellerate Type","End-User");
                   user.put("Users.Password","password");
                   long l = moUserUtility.createUser(user);
                   System.out.println("CreatingUser Done.....");
              catch(tcAPIException ae)
                   System.out.println("Error In createUser:tcAPIException "+ae.toString());
              catch(Exception e)
                   System.out.println("Error In createUser:Exception "+e.toString());
    After writing above code ,we have to create jar file.
    Steps To Be Follwed In OIM Design Console
    1)Copy jar file in ScheduleTask folder of your OIM server installation.
    2)Expand administration tree & select TaskScheduler.
    3)Create new task & in class name textfield we have to mention package.classname & mention appropriate values in other textfields & execute it.
    4)Check output.

    We need to override 2 methods while extending from SchedulerBaseTask i.e
    init() :- this method is run before execute by the scheduler .
    execute() :- is executed by the scheduler.
    Revised code :-
    package oimscheduler;
    import java.util.HashMap;
    import Thor.API.Operations.tcUserOperationsIntf;
    import Thor.API.Exceptions.tcAPIException;
    import com.thortech.xl.scheduler.tasks.SchedulerBaseTask;
    public class Scheduler extends SchedulerBaseTask
         tcUserOperationsIntf moUserUtility = null;
         @Override
         public void init()
              try
                   System.out.println("In Init");
                   moUserUtility = (tcUserOperationsIntf) this.getUtility("Thor.API.Operations.tcUserOperationsIntf");
              catch (tcAPIException e)
                   e.printStackTrace();
         protected void execute()
              try
                   System.out.println("Executing Scheduler.....");
                   createUser();
                   System.out.println("Back In execute fn !!!");
              catch(Exception e)
                   System.out.println("Error In execute : "+e.toString());
         public void createUser()
              System.out.println("<<< In createUser Fn >>>");
              try
                   HashMap user = new HashMap();
                   user.put("Users.User ID","OIM-API-SCH1");
                   user.put("Users.First Name","Oracle-SCH1");
                   user.put("Users.Middle Name","JAVA-SCH1");
                   user.put("Users.Last Name","SUN-SCH1");
                   user.put("Organizations.Key","1");
                   user.put("Users.Role","Full-Time");
                   user.put("Users.Xellerate Type","End-User");
                   user.put("Users.Password","password");
                   long l = moUserUtility.createUser(user);
                   System.out.println("CreatingUser Done.....");
              catch(tcAPIException ae)
                   System.out.println("Error In createUser:tcAPIException "+ae.toString());
              catch(Exception e)
                   System.out.println("Error In createUser:Exception "+e.toString());
    Edited by: Rahul Shah on Jul 11, 2011 4:16 AM

  • Adding Users programatically using API with iFS

    Two questions really
    1)I was wondering if anyone on the forum could offer me some basic skeleton code on extending the ExtendedUserProfile class in order to add a single new attribute and then read it back. I'm new to Oracle related products and I need a little bit of a kick-start in the right direction.
    2)I had a look at Mark Drake's Solution to programatically adding a user through the API and tried it out, sadly I get either IFS-10600, IFS-10633 and IFS-10620 or I get IFS-20010: Failed to get PropertiesResourceBundler exception.
    Judging by the developers guide there is an error in my version of the code or there is a misconfiguration in the properties file. Maybe even it's not listed in a path or classpath somewhere.
    Which properties file is it likely to be in?
    What should the properties look like?
    Can anyone guide me as to where the clsspath should be set to?
    Thanks in advance for any assistance.

    I'm working on an example that includes subclassing the ExtendedUserProfile that will be included in my content management sample, scheduled to be published at the end of the month. I've sent you a draft of the topic that will hopefully point you in the right direction.

  • Disabling user through API call -process task-followed by an Enable User...

    Hi,
    I am running on OIM 9.1 BP11. I implemented a process task to disable the user based on a URS form field change.
    I can confirm from the log file and the resource that the Disable user (xellerate user) happened. But the user got enabled back right away. The log file showed that a scheduled task named "Enable User After Start Date" ran and enable the user. So, I disabled that scheduled task.
    Then I repeated the test again. I observed the same behavior of user being disabled and enabled again but this time, OIM called an adapter. This is what I observed in the log file:
    20988 INFO,20 Oct 2010 12:21:56,519,[XELLERATE.DATABASE],DB read: select evt.ev t_key, evt.evt_name, evt.evt_package, mil.mil_name from mil mil, evt evt w here evt.evt_key = mil.evt_key and mil.mil_key=10
    20989 DEBUG,20 Oct 2010 12:21:56,519,[XELLERATE.DATABASE],select evt.evt_key, ev t.evt_name, evt.evt_package, mil.mil_name from mil mil, evt evt where evt. evt_key = mil.evt_key and mil.mil_key=10
    20990 INFO,20 Oct 2010 12:21:56,519,[XELLERATE.PERFORMANCE],Query: DB: 0, LOAD: 0, TOTAL: 0
    20991 DEBUG,20 Oct 2010 12:21:56,519,[XELLERATE.SERVER],Class/Method: tcBusiness Obj/getSqlOperationFromMembers entered.
    20992 DEBUG,20 Oct 2010 12:21:56,519,[XELLERATE.SERVER],Class/Method: tcBusiness Obj/getSqlOperationFromMembers left.
    20993 DEBUG,20 Oct 2010 12:21:56,519,[XELLERATE.ADAPTERS],Class/Method: tcADPCla ssLoader/getClassLoader entered.
    20994 DEBUG,20 Oct 2010 12:21:56,519,[XELLERATE.ADAPTERS],Class/Method: tcADPCla ssLoader/getClassLoader left.
    20995 DEBUG,20 Oct 2010 12:21:56,520,[XELLERATE.ADAPTERS],Class/Method: tcADPCla ssLoader/findClass entered.
    20996 INFO,20 Oct 2010 12:21:56,530,[XELLERATE.ADAPTERS],Adapter: Enabling the User was initiated for the task: Enable User.
    20997 INFO,20 Oct 2010 12:21:56,531,[XELLERATE.JAVACLIENT],System Event Handler : Enabling the User
    I did exactly the same disabling user process at another client and it worked fine. I don't understand what causes OIM to call this system Event handler to re-enable the user.
    Please help.
    Thanks
    Khanh

    Do you have any Entity Adapter or Event Handler or Trigger which enables user for some condition ?
    Check your environment. If you have please remove that and try.
    Does this user has and provisioned resource ? If yes, try for some other user which doesn't have resource provisioned.

Maybe you are looking for