Hi Dan Looks like JDK is sending multiple requests around 20, I'm using 3.0 milestone release2. Is there a way to stop it from CXF layer ? When I run it as a stand alone java app, it works fine but when I integrate with my server (Tomcat 7) it doesn't seem to work
Now that CXF is using httpasyncclient 4.0, I'm using this < http://monkeyingwithjava.wordpress.com/tag/cxf/ > as a source to get this NTLM done but lot of stuff looks deprecated, like DefaultHttpAsyncClient. Are there any alternatives ? Thanks Jay -----Original Message----- From: Daniel Kulp [mailto:[email protected]] Sent: Tuesday, March 18, 2014 1:41 AM To: [email protected]; Karnam, Jayashankar Subject: Re: NTLM Authentication being cached On Mar 14, 2014, at 9:01 AM, Karnam, Jayashankar <[email protected]> wrote: > Is CXF trying to cache the Authorization objects somewhere? I have been > trying NTLM authentication with CXF, it works fine for the first invocation > if I provide wrong credentials, throws a 401 but the scenario changes after a > successful invoke. No matter how many times I change the user name or > password or even switch the authentication scheme specified to Basic, it > doesn't work. Normally for NTLM, we just delegate down into the HTTPUrlConnection in the JDK which handles this. I'm not sure if there is a way in the HttpUrlConnection to get it to re-negotiate an NTLM connection. You could try using the HTTPAsyncClient based transport where the NTLM stuff is handled by the Apache HTTP components. I think it's handled very different. > > And the number of retries that CXF using is high, I believe it's sending more > than 10 requests when I observed in TCPMon. What version of CXF? This should have been fixed. Dan > > The service im using is plain NTLM protected. > The code I'm using on the client side is > > conduit.getAuthorization().setAuthorizationType(NTLM); > > conduit.getAuthorization().setUserName(authDomain+"\\"+authUserName); > > conduit.getAuthorization().setPassword(authPassword); > } > HTTPClientPolicy httpClientPolicy = new > HTTPClientPolicy(); > httpClientPolicy.setConnectionTimeout(36000); > httpClientPolicy.setAllowChunking(false); > conduit.setClient(httpClientPolicy); > httpClientPolicy = null; > > Thanks, > Jay > -- Daniel Kulp [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
