0

In my Camel (2.13) flow, I want to call a webservice using Camel-CXF. The webservice is secured using NTLM. I did find out thaat CXF itself supports NTLM, but I can't find anything on Camel-CXF. I did try the parameters username and password of course, but that didn't work. Ik looks like Camel-CXF doesn't support it. Any ideas on how to solve this?

I'm using java6 so i don't needs jcifs I think.

Roald

  • Are you sure that the web service is using NTLM and not NTLMv2? AFAIK, CFX only supports the old and outdated version of NTLM, which due to major security issues should not be used anymore. – jarnbjo Oct 28 '14 at 15:42
  • I think you need to use the jaxws way and use jcifs library to add the authentication to your message and then propagate the message. refer following link if you are deploying in a Linux box or for custom username password addition http://jcifs.samba.org/ – Naveen Raj Oct 30 '14 at 13:37
  • Can you show us the configuration of camel-cxf endpoint? – Willem Jiang Oct 31 '14 at 03:22

1 Answers1

0
<cxf:cxfEndpoint id="sharepointQueryEndpoint"
                     address="http://yourhostwithpathtowsdl/_vti_bin/search.asmx"
                     serviceClass="com.somewhere.special.generated.QueryServiceSoap" 
                     endpointName="ssp:SecureConnection"
                     xmlns:ssp="http://microsoft.com/webservices/OfficeServer/QueryService"
            >

        <cxf:properties>
            <entry key="dataFormat" value="POJO"/>
            <entry key="loggingFeatureEnabled" value="true" />
        </cxf:properties>
        <cxf:inInterceptors>
            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
        </cxf:inInterceptors>

        <cxf:outInterceptors>
            <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
        </cxf:outInterceptors>
    </cxf:cxfEndpoint>

    <http:conduit name="{http://microsoft.com/webservices/OfficeServer/QueryService}SecureConnection.http-conduit">
        <http:client
                AllowChunking="false"
                MaxRetransmits="11"
                Connection="Keep-Alive"
                ReceiveTimeout="60000"
                CacheControl="No-Cache"
                />

        <http:authorization>
            <sec:UserName>Domain\Username</sec:UserName>
            <sec:Password>Password</sec:Password>
            <sec:Authorization>NTLM</sec:Authorization>
        </http:authorization>

    </http:conduit>

The attribute serviceClass in the cxfEndpoint configuration is point to the Interface which is generated by wsdl2java.enter code here Note: When this condfiguration is run from a Windows based machine it is not working. During the handshake it will substitute the configured username/password in the http-conduit with the credentials of the user currently logged in. See Can Java's 'single sign-on' (use credentials from 'Credential Manager') on Windows be disabled? for more information

Community
  • 1
  • 1