Hi, Michael: I turned the log and found the following msg: HTTP 401.4 - Unauthorized: Authorization denied by filter
I am using IIS5.1 and have 5 pre-installed filters on XP. Is it really filter issue because I can pass Basic Authentication with java.net.HttpURLConnection code as follows? import java.util.List; import java.net.URL; import java.net.MalformedURLException; import java.net.HttpURLConnection; import java.io.IOException; import sun.misc.BASE64Encoder; public class BasicAuthenticationExample1 { private static BASE64Encoder encoder = new BASE64Encoder(); /** * Constructor for BasicAuthenticatonExample. */ public BasicAuthenticationExample1() { } public static void main(String[] args) throws Exception { URL url = null; try { url = new URL("http://10.8.9.22/index.html"); } catch (MalformedURLException mue) { System.out.println("url not exist"); } // create a httpURLConnection to the url specified above // catch an IOException if a connection cannot be established HttpURLConnection connection = null; try { connection = (HttpURLConnection) url.openConnection(); } catch (IOException io) { System.out.println("no connection is established!"); } String authorization = encoder.encode(new String("username" + ":" + "password").getBytes()); connection.setRequestProperty("Authorization", "Basic " + authorization); int responseCode = connection.getResponseCode(); System.out.println(responseCode); } } lili Thanks -----Original Message----- From: Michael Becke [mailto:[EMAIL PROTECTED] Sent: Monday, April 12, 2004 7:51 PM To: Commons HttpClient Project Subject: Re: BasicAuthentication with "Maximum redirects (100) exceeded" erro r Hi Lili, It sounds like you've gotten into an recursive redirection loop. Please post the wire log <http://jakarta.apache.org/commons/httpclient/logging.html> for a couple of the redirections, and we should be able to diagnose the problem. Feel free to obfuscate any sensitive information in the logs. Mike On Apr 12, 2004, at 7:30 PM, Lili Liu wrote: > Not sure whether this is the right group to ask questions. > > I am implementing BasicAuthenticationExample.java (distributed with > httpclient src) with IIS server on local host. > But I keep get the error msg: > > SEVERE: Narrowly avoided an infinite loop in execute > Exception in thread "main" > org.apache.commons.httpclient.HttpRecoverableExceptio > n: Maximum redirects (100) exceeded > > Any information is highly appreciated. > Thanks. > lili > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]