hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rowe, David (CAG-CC MIS)" <David.Ro...@conagrafoods.com>
Subject RE: NTLM Auth Code Snippet
Date Wed, 13 Aug 2003 14:29:33 GMT
Attached is a wire-log, from a test run this morning, fresh build off HEAD. (Still having problems
getting Branches in Eclipse)

Thanks,
Dave


-----Original Message-----
From: Oleg Kalnichevski [mailto:olegk@apache.org]
Sent: Tuesday, August 12, 2003 4:31 PM
To: Commons HttpClient Project
Subject: Re: NTLM Auth Code Snippet


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
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Mime
View raw message