Q:

Setting caller principal when activating REST

We are working with WAS server of IBM.
I am activating an http request to server (using controller of websphere) - the browwser user exists on the WSSubject.getCallerPrincipal.
But when I am trying to activate REST request with HTTP protocol from inside the server (in the request above) to a different server, the user is empty.
(currently, it is the same machine and server, but it will change later on).
How can I set the user so it will be the user principal when the second http call is recieved (from server to server)
thank you.

A:

We finally found the answer.
We are using wink client to do the REST call.
Adding: LtpaAuthSecurityHandler handler solve the issue.
see the IBM article: 
https://www.ibm.com/support/knowledgecenter/en/SS7K4U_8.5.5/com.ibm.websphere.zseries.doc/ae/twbs_jaxrs_impl_securejaxrs_downstreamresource.html
Here is the code:
ClientConfig config = new ClientConfig();
LtpaAuthSecurityHandler secHandler = new LtpaAuthSecurityHandler(); 
config.handlers(secHandler);
RestClient client =new RestClient(config);
Resource resource = client.resource(uriBuilder.build());

