1 Reply Latest reply: May 24, 2013 5:06 AM by idamGod RSS

    Issue with user key fetching using API, OIM 11.1.2

    kavatam
      Hi All,

      I am using post process handler to generate custom userLogin. In this code, am fetching userkey as

      String entityID=paramOrchestration.getTarget().getEntityId();

      User is getting created but with below Error



      [ecid: 811220ed6c7d2fc4:2b61ac71:13ed1bbbde9:-8000-0000000000012d40,0] [APP: oim#11.1.2.0.0] An error occurred while locking the account for user with login {0}[[
      oracle.iam.identity.exception.NoSuchUserException: IAM-3050021:The user with the key null does not exist.:null
           at oracle.iam.identity.usermgmt.impl.UserMgrUtil.findEntity(UserMgrUtil.java:775)
           at oracle.iam.identity.usermgmt.impl.UserMgrUtil.findUser(UserMgrUtil.java:822)
           at oracle.iam.identity.usermgmt.impl.UserManagerImpl.getDetails(UserManagerImpl.java:1285)
           at oracle.iam.identity.usermgmt.impl.UserManagerImpl.getDetails(UserManagerImpl.java:1239)
           at sun.reflect.GeneratedMethodAccessor1694.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:601)
           at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
           at oracle.iam.platform.utils.DMSMethodInterceptor.invoke(DMSMethodInterceptor.java:25)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
           at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
           at com.sun.proxy.$Proxy254.getDetails(Unknown Source)
           at oracle.iam.selfservice.uself.uselfmgmt.impl.handlers.create.SelfServiceNotificationHandler.getUserInfo(SelfServiceNotificationHandler.java:337)
           at oracle.iam.selfservice.uself.uselfmgmt.impl.handlers.create.SelfServiceNotificationHandler.execute(SelfServiceNotificationHandler.java:161)
           at oracle.iam.platform.kernel.impl.OrchProcessData.runPostProcessEvents(OrchProcessData.java:1258)
           at oracle.iam.platform.kernel.impl.OrchProcessData.runEvents(OrchProcessData.java:767)
           at oracle.iam.platform.kernel.impl.OrchProcessData.executeEvents(OrchProcessData.java:268)
           at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.resumeProcess(OrchestrationEngineImpl.java:816)
           at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.resumeProcess(OrchestrationEngineImpl.java:847)
           at oracle.iam.platform.kernel.impl.OrhestrationAsyncTask.execute(OrhestrationAsyncTask.java:129)
           at oracle.iam.platform.async.impl.TaskExecutor.executeUnmanagedTask(TaskExecutor.java:99)
           at oracle.iam.platform.async.impl.TaskExecutor.execute(TaskExecutor.java:69)
           at oracle.iam.platform.async.messaging.MessageReceiver.onMessage(MessageReceiver.java:68)
           at sun.reflect.GeneratedMethodAccessor3069.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:601)
           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.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 com.sun.proxy.$Proxy301.onMessage(Unknown Source)
           at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:583)
           at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:486)
           at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:388)
           at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4659)
           at weblogic.jms.client.JMSSession.execute(JMSSession.java:4345)
           at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3821)
           at weblogic.jms.client.JMSSession.access$000(JMSSession.java:115)
           at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5170)
           at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
           at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
           at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)



      I found in oracle forums, that we have to use below code to fetch userkey
      private String getUserKey(long processID, Orchestration orchestration)
      {
           String userKey;
           String entityType = orchestration.getTarget().getType();
           EventResult result = new EventResult();

           if (!orchestration.getOperation().equals("CREATE"))
           {
                userKey = orchestration.getTarget().getEntityId();
           }
           else
           {
                OrchestrationEngine orchEngine = Platform.getService(OrchestrationEngine.class);
                userKey = (String)orchEngine.getActionResult(processID);
           }
           return userKey;
      }


      but "OrchestrationEngine" is not found in OIM 11.1.2 API


      Please provide solution to this issue.

      Thanks in advance
        • 1. Re: Issue with user key fetching using API, OIM 11.1.2
          idamGod
          Try the below.

          public EventResult execute(long processId, long eventId, Orchestration orchestration) {
          HashMap<String, Serializable> parameters =orchestration.getParameters();

          String operation = orchestration.getOperation();
          if (operation.equalsIgnoreCase("Create")) {
          String userKey =getParamaterValue(parameters, UserManagerConstants.AttributeName.USER_KEY.getId());
          System.out.println("User Key:"+userKey);
          }
          return new EventResult();
          }


          private String getParamaterValue(HashMap<String, Serializable> params, String key) {
          String value = (params.get(key) instanceof ContextAware) ? (String)((ContextAware)params.get(key)).getObjectValue() : (String)params.get(key);
          return value;
          }