You'll probably have to write a CXF interceptor to grab the header and
extract the Basic Auth username manually. For example:

https://github.com/apache/cxf/blob/master/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/HttpsTokenInterceptorProvider.java#L156

On Fri, Jun 2, 2017 at 12:37 PM, Jorgen Chr Grooss <
[email protected]> wrote:

> Hi,
>
> I have had the task to create a WS based on an existing WSDL.
> I used CXF 3.1.11 to create it, and deployed it on Tomcat with basic
> authentication.
> And all that worked fine.
>
> I use the username in my service by getting a Pricipal in the WS.
> java.security.Principal principal = wsContext.getUserPrincipal();
>
> However now I need to call the WS without password is authenticated, but
> still I need the username in my WS.
> If I do not authenticate in Tomcat the getUserPrincipal() returns null.
> I can see that I do a lot of things in CXF, but I cannot point out how to
> do it.
> Can you help me in the right direction?
>
>
> Best Regards
>
> Jørgen Christian
>



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Reply via email to