You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by gira1 <ha...@giraone.com> on 2014/12/30 17:25:43 UTC

Authorization loop using "CurrentWindowsCredentials"

I am trying to access a WCF service that is using NTLM authentication. More
precise, the WCF binding is defined in C# using:

binding.Security.Transport.ClientCredentialType =
HttpClientCredentialType.Ntlm;

I have read a lot of documentation and I am able now to access the service
using a CXF 3.0.3 client configured to use AsyncHTTPConduit.
But currently it work only with windows credential, that are explictly given
using

(1) org.apache.http.auth.NTCredentials

and not with

*(2) org.apache.http.impl.auth.win.CurrentWindowsCredentials* (Maven GAV is
org.apache.httpcomponents/winauth-jni /4.3.6)

When I use (2), I get a "Authorization loop detected on Conduit" exception. 

The code is the following:



Stacktrace is



Technically it should work using CurrentWindowsCredentials, because I am
able to access the same service and bypassing the NTLM authentication with
client code using the latest Apache HttpComponents directly and a simple
HTTP POST request. When using HttpComponents directly, I use the code



What I have tried already is overwriting the method
setupNIOClient(HTTPClientPolicy clientPolicy) from
org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduitFactory. When I
replace the original build() code within this method:

Original:


by



I get my CXF code working. So currently I think there is to technical
obstacle and either I am using the wrong code sequence or what I assume is
that maybe I am the first who tries to use CurrentWindowsCredentials
together with CXF.



--
View this message in context: http://cxf.547215.n5.nabble.com/Authorization-loop-using-CurrentWindowsCredentials-tp5752751.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Authorization loop using "CurrentWindowsCredentials"

Posted by gira1 <ha...@giraone.com>.
I opened  https://issues.apache.org/jira/browse/CXF-6188
<https://issues.apache.org/jira/browse/CXF-6188>  .



--
View this message in context: http://cxf.547215.n5.nabble.com/Authorization-loop-using-CurrentWindowsCredentials-tp5752751p5752827.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Authorization loop using "CurrentWindowsCredentials"

Posted by Colm O hEigeartaigh <co...@apache.org>.
Hi,

I suspect you may indeed be the first one to use CurrentWindowCredentials
together with CXF. Could you create a JIRA along with a patch that
describes the change you made to setupNIOClient?

Colm.

On Tue, Dec 30, 2014 at 4:25 PM, gira1 <ha...@giraone.com> wrote:

> I am trying to access a WCF service that is using NTLM authentication. More
> precise, the WCF binding is defined in C# using:
>
> binding.Security.Transport.ClientCredentialType =
> HttpClientCredentialType.Ntlm;
>
> I have read a lot of documentation and I am able now to access the service
> using a CXF 3.0.3 client configured to use AsyncHTTPConduit.
> But currently it work only with windows credential, that are explictly
> given
> using
>
> (1) org.apache.http.auth.NTCredentials
>
> and not with
>
> *(2) org.apache.http.impl.auth.win.CurrentWindowsCredentials* (Maven GAV is
> org.apache.httpcomponents/winauth-jni /4.3.6)
>
> When I use (2), I get a "Authorization loop detected on Conduit" exception.
>
> The code is the following:
>
>
>
> Stacktrace is
>
>
>
> Technically it should work using CurrentWindowsCredentials, because I am
> able to access the same service and bypassing the NTLM authentication with
> client code using the latest Apache HttpComponents directly and a simple
> HTTP POST request. When using HttpComponents directly, I use the code
>
>
>
> What I have tried already is overwriting the method
> setupNIOClient(HTTPClientPolicy clientPolicy) from
> org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduitFactory. When I
> replace the original build() code within this method:
>
> Original:
>
>
> by
>
>
>
> I get my CXF code working. So currently I think there is to technical
> obstacle and either I am using the wrong code sequence or what I assume is
> that maybe I am the first who tries to use CurrentWindowsCredentials
> together with CXF.
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Authorization-loop-using-CurrentWindowsCredentials-tp5752751.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>



-- 
Colm O hEigeartaigh

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