Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 67C52DDD0 for ; Tue, 2 Oct 2012 00:50:08 +0000 (UTC) Received: (qmail 56521 invoked by uid 500); 2 Oct 2012 00:50:08 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 56484 invoked by uid 500); 2 Oct 2012 00:50:08 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 56420 invoked by uid 99); 2 Oct 2012 00:50:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Oct 2012 00:50:07 +0000 Date: Tue, 2 Oct 2012 11:50:07 +1100 (NCT) From: "Shaun Elliott (JIRA)" To: issues@cxf.apache.org Message-ID: <1006095636.152269.1349139007982.JavaMail.jiratomcat@arcas> In-Reply-To: <854462583.136122.1348782668082.JavaMail.jiratomcat@arcas> Subject: [jira] [Comment Edited] (CXF-4525) expose http client, allow for NTLM authentication MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-4525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13467363#comment-13467363 ] Shaun Elliott edited comment on CXF-4525 at 10/2/12 11:49 AM: -------------------------------------------------------------- I've got it to work, thanks a bunch! A couple of things to note: 1) Before I got it to work, I still had adjustments to the client as a relic of the old basic auth code: {code} HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); httpClientPolicy.setConnectionTimeout( 36000 ); httpClientPolicy.setAllowChunking( false ); http.setClient( httpClientPolicy ); {code} But that obviously won't work. What I got to work (for documentation purposes) was based on your unit test instead (thanks for that): {code} Bus bus = BusFactory.getDefaultBus(); bus.setProperty( "use.async.http.conduit", "true" ); Client client = ClientProxy.getClient( proxy ); HTTPConduit http = (HTTPConduit)client.getConduit(); if ( http instanceof AsyncHTTPConduit ) { AsyncHTTPConduit conduit = (AsyncHTTPConduit)http; DefaultHttpAsyncClient defaultHttpAsyncClient; try { defaultHttpAsyncClient = conduit.getHttpAsyncClient(); } catch ( IOException exception ) { throw new RuntimeException( exception ); } defaultHttpAsyncClient.getCredentialsProvider().setCredentials( AuthScope.ANY, new NTCredentials( "username", "password", "", "domain" ) ); conduit.getClient().setAllowChunking( false ); conduit.getClient().setAutoRedirect( true ); } {code} Hopefully that will help someone else on down the line or give you guys documentation for "how to do NTLM authentication with CXF". p.s. The old link suggests using jcifs, which, I believe does not work unless running on Windows XP\NT (very poor solution, I could not get it to work). 2) Is CXF 2.7.0 planned to be java 1.6? I could not get it to work with 1.5. Thanks again! was (Author: selliott): I've got it to work, thanks a bunch! A couple of things to note: 1) Before I got it to work, I still had adjustments to the client as a relic of the old basic auth code: {code} HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); httpClientPolicy.setConnectionTimeout( 36000 ); httpClientPolicy.setAllowChunking( false ); http.setClient( httpClientPolicy ); {code} But that obviously won't work. What I got to work (for documentation purposes) was based on your unit test instead (thanks for that): {code} Client client = ClientProxy.getClient( proxy ); HTTPConduit http = (HTTPConduit)client.getConduit(); if ( http instanceof AsyncHTTPConduit ) { AsyncHTTPConduit conduit = (AsyncHTTPConduit)http; DefaultHttpAsyncClient defaultHttpAsyncClient; try { defaultHttpAsyncClient = conduit.getHttpAsyncClient(); } catch ( IOException exception ) { throw new RuntimeException( exception ); } defaultHttpAsyncClient.getCredentialsProvider().setCredentials( AuthScope.ANY, new NTCredentials( "username", "password", "", "domain" ) ); conduit.getClient().setAllowChunking( false ); conduit.getClient().setAutoRedirect( true ); } {code} Hopefully that will help someone else on down the line or give you guys documentation for "how to do NTLM authentication with CXF". p.s. The old link suggests using jcifs, which, I believe does not work unless running on Windows XP\NT (very poor solution, I could not get it to work). 2) Is CXF 2.7.0 planned to be java 1.6? I could not get it to work with 1.5. Thanks again! > expose http client, allow for NTLM authentication > ------------------------------------------------- > > Key: CXF-4525 > URL: https://issues.apache.org/jira/browse/CXF-4525 > Project: CXF > Issue Type: Improvement > Components: Transports > Affects Versions: 2.7.0 > Reporter: Shaun Elliott > Assignee: Daniel Kulp > Fix For: 2.7.0 > > > The class: CXFAsyncRequester hides the DefaultHttpAsyncClient, thus preventing interaction from outside classes. One use case would be to leverage the embedded DefaultHttpAsyncClient to do NTLM authentication, which is currently not possible with CXF. > AsyncHTTPConduit will also need a getter on the factory field. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira