Return-Path: Mailing-List: contact commons-httpclient-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-httpclient-dev@jakarta.apache.org Received: (qmail 68015 invoked from network); 12 Aug 2003 21:31:16 -0000 Received: from mail2.bluewin.ch (195.186.4.73) by daedalus.apache.org with SMTP; 12 Aug 2003 21:31:16 -0000 Received: from fatboy (62.203.127.32) by mail2.bluewin.ch (Bluewin AG 7.0.019) id 3F2FA197000B7E30 for commons-httpclient-dev@jakarta.apache.org; Tue, 12 Aug 2003 21:31:22 +0000 Subject: Re: NTLM Auth Code Snippet From: Oleg Kalnichevski Reply-To: olegk@apache.org To: Commons HttpClient Project In-Reply-To: <040B052AFD639D44996AF4C1FBF4781801F082@CEPXMB03.cag.conagrafoods.net> References: <040B052AFD639D44996AF4C1FBF4781801F082@CEPXMB03.cag.conagrafoods.net> Content-Type: text/plain Message-Id: <1060723878.2491.26.camel@kczrh-okt22.corp.bearingpoint.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Tue, 12 Aug 2003 23:31:19 +0200 Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N David, As far as I can tell the code looks all right. My only guess was that the parameters to NTCredentials constructor might have been messed up, but that does not seem to be the case. I just tested the latest snapshot of 2.0 branch and HEAD against Squid proxy using Basic authentication scheme. No surprises there. Unfortunately I cannot test HTTP communication via a proxy with NTLM authentication as I do not have a single one at my disposal (I tried to configure Squid to use NTLM instead of Basic, but to no avail). I know HttpClient has been reported to work fine with NTLM proxies on more than one occasion. So, I would still like to kindly ask you to double-check the credentials you have been used to authenticate with the proxy. If you are 100% sure the credentials are fine, send us the complete wire & debug log. If you happen to have access to the proxy server in question it would also be worthwhile checking the server logs to see if there are any clues as to why the authentication has been refused Oleg On Tue, 2003-08-12 at 23:00, Rowe, David (CAG-CC MIS) wrote: > public class Authentication > { > public Authentication() { } > > public static void main(String[] args) throws Exception > { > System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog"); > System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire", "debug"); > System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "debug"); > > HttpClient client = new HttpClient(); > > client.getHostConfiguration().setProxy("[our proxy]", 80); > > client.getState().setProxyCredentials(null,null, > new NTCredentials("[user name]", "[password]", "[our proxy]", "[domain]") > ); > > GetMethod get = new GetMethod("http://www.yahoo.com"); > > get.setDoAuthentication( true ); > > int status = client.executeMethod( get ); > > System.out.println(status + "\n" + get.getResponseBodyAsString()); > > get.releaseConnection(); > } > } > > > Supposedly this should Authenticate through the proxy, and output Yahoo!'s website. > > If you can see anything that is needed please respond... > > David Rowe > ConAgra Foods, Inc. > Web Application Development - Intern > 7350 World Communications Drive > Omaha, NE 68122 > Phone: (402) 998-2722 > David.Rowe2@conagrafoods.com > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org >