Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Get authenticated user in cCxf / mediation route

Hello all,

it may be pure CXF question, but I'll risk it to ask here as well.. (related to mediation routes)

Having a cCxf is there a way to get the username (or other identifier) of the authenticated user?

When using WS-Security with the Camel-CXF,  the user principal object is stored in the CameCxfMessage header and is not really accessible for further processing (it may make sense, as the UT is not the only way to authenticate the subject and getting the SAML, Kerberos or STS ticket is not always useful).

Thanks for any hint.

Have fun
     Gabriel
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

ok, please disregard, just found a way to get it using a bean..

org.apache.cxf.message.Message cxfMessage = in.getHeader(CxfConstants.CAMEL_CXF_MESSAGE, org.apache.cxf.message.Message.class);
HttpServletRequest request = (HttpServletRequest)cxfMessage.get("HTTP.REQUEST");
String username = request.getUserPrincipal().getName();

g.

View solution in original post

1 Reply
Anonymous
Not applicable
Author

ok, please disregard, just found a way to get it using a bean..

org.apache.cxf.message.Message cxfMessage = in.getHeader(CxfConstants.CAMEL_CXF_MESSAGE, org.apache.cxf.message.Message.class);
HttpServletRequest request = (HttpServletRequest)cxfMessage.get("HTTP.REQUEST");
String username = request.getUserPrincipal().getName();

g.