Search code examples
identityentitlementsidentity-managementoimidentitymanager

OIMService.doOperation failing with ArrayIndexOutOfBoundsException for revoking entitlements


I am trying to revoke AD entitlement via OIMService API, it is a single method which takes care of provisioning and deprovisioning the entitlement.

The provisioning works fine without any exception but deprovisioning fails with the following exception.

I am using following configuration while raising request:

            requestEntity
                .setOperation(RequestConstants.MODEL_REVOKE_ENTITLEMENT_OPERATION);

with

  OperationResult result = this.oimService.doOperation(requestData,
            OIMService.Intent.DIRECT);

Rest of the code is as per the oracle API docs which can be found here The complete exception is as follows.

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:635)
at java.util.ArrayList.get(ArrayList.java:411)
at oracle.iam.request.util.RequestUtil.getAuthorizationEntityKey(RequestUtil.java:2255)
at oracle.iam.request.impl.RequestEngine.performAuthzChecksForRequester(RequestEngine.java:5304)
at oracle.iam.request.impl.RequestEngine.performAuthzChecksForRequester(RequestEngine.java:5147)
at oracle.iam.request.impl.RequestEngine.isOperationAllowed(RequestEngine.java:4714)
at oracle.iam.request.impl.RequestEngine.performAuthzAndRequestOverrideChecks(RequestEngine.java:4556)
at oracle.iam.request.impl.RequestEngine.doOperation(RequestEngine.java:4523)
at oracle.iam.impl.OIMServiceImpl.doOperation(OIMServiceImpl.java:43)
at sun.reflect.GeneratedMethodAccessor6219.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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:35)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy353.doOperation(Unknown Source)
at oracle.iam.api.OIMServiceEJB.doOperationx(Unknown Source)
at sun.reflect.GeneratedMethodAccessor6218.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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.oracle.pitchfork.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:34)
at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
at com.oracle.pitchfork.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:42)
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 com.sun.proxy.$Proxy524.doOperationx(Unknown Source)
at oracle.iam.api.OIMService_1soh89_OIMServiceRemoteImpl.__WL_invoke(Unknown Source)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
at oracle.iam.api.OIMService_1soh89_OIMServiceRemoteImpl.doOperationx(Unknown Source)
at oracle.iam.api.OIMService_1soh89_OIMServiceRemoteImpl_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:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

Solution

  • I was using OIMService API for grant and revoke entitlement. Though the rest code remains the same, there is a important attribute needs to be changed while provisioning and deprovisioing entitlement.

    attribute name is `entityKey` 
    RequestBeneficiaryEntity requestEntity = new RequestBeneficiaryEntity();
    
    requestEntity.setEntityKey(entityKey);
    

    which is entitlement.getEntitlementKey(); for Provisioning and entitlementInstance.getEntitlementInstanceKey() for deprovisioning