Hi,
i am trying to use impersonation for uploading , downloading files with default custom dfs services like ObjectService ,
QueryService,VersionControlService .i am getting the following error at the backend and i am not able to upload the file.[[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'] [08 Aug 2012 08:37:54,124] - it.sella.issdfsphase2.core.DocumentDFSProcessor -DEBUG: DocumentDFSProcessor ServiceException
com.emc.documentum.fs.rt.AuthenticationException: Authorization failed, please review the identities provided. [DM_SESSION_E_AUTH_FAIL]error: "Authentication failed for user gbs02318 with docbase apprepo."
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.emc.documentum.fs.rt.context.impl.compat.ClientReflectionServiceInvokerCompat60.getExceptionInstance(ClientReflectionServiceInvokerCompat60.java:180)
at com.emc.documentum.fs.rt.context.impl.compat.ClientReflectionServiceInvokerCompat60.invoke(ClientReflectionServiceInvokerCompat60.java:78)
at com.emc.documentum.fs.rt.context.impl.UcfClientInvocationHandler.handleUCF(UcfClientInvocationHandler.java:62)
at com.emc.documentum.fs.rt.context.impl.UcfClientInvocationHandler.invoke(UcfClientInvocationHandler.java:42)
at com.emc.documentum.fs.rt.context.impl.SoapClientInvocationHandler.invoke(SoapClientInvocationHandler.java:66)
at com.emc.documentum.fs.rt.context.impl.MtomCompatHandler60SP1.invoke(MtomCompatHandler60SP1.java:60)
at com.emc.documentum.fs.rt.context.impl.HttpSessionInvocationHandler.invoke(HttpSessionInvocationHandler.java:88)
at com.emc.documentum.fs.rt.context.impl.RemoteServiceInterfaceInvocationHandler.invoke(RemoteServiceInterfaceInvocationHandler.java:30)
at com.emc.documentum.fs.rt.context.impl.ReturnedContentTransformationHandler.invoke(ReturnedContentTransformationHandler.java:45)
at com.emc.documentum.fs.rt.context.impl.OperationOptionsHandler.invoke(OperationOptionsHandler.java:72)
at com.emc.documentum.fs.rt.context.impl.ContextThreadLocalInvocationHandler.invoke(ContextThreadLocalInvocationHandler.java:51)
at com.emc.documentum.fs.rt.context.impl.ServiceContextInvocationHandler.invoke(ServiceContextInvocationHandler.java:30)
at $Proxy230.execute(Unknown Source) source code: 1)
ContentTransferProfile contentTransferProfile = new ContentTransferProfile();contentTransferProfile.setTransferMode(ContentTransferMode.UCF);
contentTransferProfile.setContentRegistryOption(ContentRegistryOption.UNREGISTERED);
ContentProfile contentProfile = new ContentProfile();2)
Admin user Service context is set as follows:IServiceContext context = contextFactory.newContext();
RepositoryIdentity repoId = new RepositoryIdentity(); repoId.setRepositoryName("repository name ");repoId.setUserName("admin user name ");repoId.setPassword("admin password );context.addIdentity(repoId);3)
------------------------------------------------------------------------
then i make a call to my own custom internal service which uses the DFC classes to generated the loggedin user token .
the code snippet that i used for getting the loggedin user token in dfc :
calling the following method i get the logged in user token : getLoginTicketEx("loggedUser Name", "global", 10, false, "server Name");
-----------------------------------------------------------------------
Then i try to impersonate with the loggedin user and perform the uploading and downloading functionalities using the DFS services like ObjectService ,
to impersonate i have set the loggedin user token and username in the admin ServiceContext as follows :
RepositoryIdentity repoId = new RepositoryIdentity();
repoId.setRepositoryName("repository name ");repoId.setUserName("loggedin user name ");repoId.setPassword("loggedin user token );adminServiceContext.addIdentity(repoId);after setting the ServiceContext with the loggedin user token as loggedUserServiceContext 5)then i make the DFS already present services for my uploading and downloading ServiceFactory serviceFactory = ServiceFactory.getInstance();loggedUserServiceContext = contextFactory.register(loggedUserServiceContext, "core", "http://" + "te-ecm.bansel.it" + "/services/");objectService = serviceFactory.getRemoteService( IObjectService.class, loggedUserServiceContext,"core","http://" + "te-ecm.bansel.it" + "/services"); querySvc = serviceFactory.getRemoteService(IQueryService.class,loggedUserServiceContext, "core", "http://" + "te-ecm.bansel.it" + "/services");
versionSvc = serviceFactory.getRemoteService(IVersionControlService.class,loggedUserServiceContext, "core", "http://" + "te-ecm.bansel.it" + "/services");
6) then when i make use of the DFS queryservice and execute the query to find if the document is present already
PassthroughQuery query = new PassthroughQuery();
String queryString =" select r_object_id, object_name FROM dm_sysobject (ALL) s, dm_sysobject_r sr, dm_folder_r fr" +
" WHERE any r_version_label in ('CURRENT') AND s.i_is_deleted = 0 " +
" AND sr.i_position = -1 AND sr.r_object_id = s.r_object_id AND fr.r_object_id = sr.i_folder_id "+
" AND fr.i_position = -1 AND s.r_object_type = 'dm_document' AND ((object_name LIKE '%"+ fileName+"%' " +
" OR title LIKE '%"+ fileName+"%' OR subject LIKE '%"+ fileName+"%')) " +
" AND fr.r_folder_path = '"+destPath+"'";
query.setQueryString(queryString);
query.addRepository(repositoryName);
log.debug("Query String :" + queryString);
QueryExecution queryEx = new QueryExecution();
queryEx.setCacheStrategyType(CacheStrategyType.DEFAULT_CACHE_STRATEGY);
OperationOptions operationOptions = new OperationOptions();
ContentTransferProfile conTrProfile = new ContentTransferProfile();
conTrProfile.setTransferMode(ContentTransferMode.UCF);
conTrProfile.setCachedContentTransferAllowed(true);
operationOptions.setContentTransferProfile(conTrProfile);
operationOptions.setContentProfile(contentProfile);
log.debug("before Query Result Execution");
QueryResult queryResult = querySvc.execute(query, queryEx, operationOptions);
i am getting the above exception related with the Authorization failed
Caused by: com.emc.documentum.fs.rt.AuthenticationException: Authorization failed, please review identities provided in service context "dctstas02/172.22.35.6-1344407870337-6638292639087258393-2". [DM_SESSION_E_AUTH_FAIL]error: "Authentication failed for user gbs02318 with docbase apprepo."
Please somebody let me know what is wrong with the code .
it is very urgent please respond as sson as possible .
thanks
Xavier