Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Is there an equivalent of IImpersonationService for plain java API?

 Hi,
is possible to impersonate other user with plain java API as it is possible on server side?

I'd like to perform some action from inside a build and I don't like to pass user/password information in order to login to the server. I'd prefer to use a single technical user that can impersonate other users.

Thanks,
Michele.

1

2 votes



3 answers

Permanent link
I am not sure I understand the question. If you run something in a build, it is run in the context of the user running the build - which is usually a technical user.. You can also pass arguments like another user ID or password, or read them (I think) from a password file to use another user. However, there is no way to act as another user I am aware of.

0 votes


Permanent link
 Ralph,
I'd like to impersonate other users using a technical JazzAdmin user (as I can do on server side) because otherwise I would have to create password files for each user on the compile machine in order to use on custom tasks (I don't like to put password directly in build properties for security reason).

Thanks,
Michele. 

0 votes


Permanent link
com.ibm.team.repository.service.IImpersonationService is not available as Plain Java Client API. Anyway, you could try to add it from RTC SDK to your client classpath and then to get it as:
IImpersonationService impersonationService = (IImpersonationService) ((IClientLibraryContext) repo).getServiceInterface(IImpersonationService.class);
Maybe... :)

0 votes

Comments

Does it works? Have you tried? Generally I've always had problems when I tried to mix Plain API and SDK, but if it works without side effects I will give a try :-)  

Well, impersonating users works but you cannot just invoking  IImpersonationService from a plain Java client due to:

com.ibm.team.repository.common.TeamRepositoryException: CRJAZ0055E The com.ibm.team.repository.service.IImpersonationService service is not accessible remotely.
at com.ibm.team.repository.client.internal.ServiceInterfaceProxy.validateServiceCall(ServiceInterfaceProxy.java:285)
at com.ibm.team.repository.client.internal.ServiceInterfaceProxy.invoke(ServiceInterfaceProxy.java:109)
at com.sun.proxy.$Proxy25.runAs(Unknown Source)
You have to do some work:
  1. a
Sure, it's a GIANT hack but it works! :)
Cheers.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,952
× 169
× 63
× 25
× 1

Question asked: Jan 29 '14, 9:39 a.m.

Question was seen: 7,762 times

Last updated: Apr 12 '19, 9:29 a.m.

Confirmation Cancel Confirm