cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: NTLM Authentication being cached
Date Mon, 17 Mar 2014 20:11:06 GMT

On Mar 14, 2014, at 9:01 AM, Karnam, Jayashankar <Jayashankar.Karnam@in.pega.com> 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
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Mime
View raw message