commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brad Clarke" <bgclark...@hotmail.com>
Subject HTTPClient basic authentication against LinkSys router
Date Tue, 15 Jul 2003 01:49:43 GMT
I am migrating some code that was originally using Ronald Tschalär
HTTPClient code to the Apache commons HTTPClient (beta 2).

I have used the BasicAuthenticatonExample as the basis for my test.

The problem I am having is that if I use:

            client.getState().setCredentials("192.168.1.1",
               "Linksys BEFSR41/BEFSR11/BEFSRU31",
                new UsernamePasswordCredentials("user", "password"));
            GetMethod get = new GetMethod("http://192.168.1.1/Status.htm");
            get.setDoAuthentication( true );

I get a 401 error.

If I use the deprecated format:
            client.getState().setCredentials("Linksys
BEFSR41/BEFSR11/BEFSRU31",
                new UsernamePasswordCredentials("user", "password"));
            GetMethod get = new GetMethod("http://192.168.1.1/Status.htm");
            get.setDoAuthentication( true );

It works fine.

I've tried different forms of "192.168.1.1" in the setCredentials, but
nothing seems to work.

The LinkSys router does not have a true http server onboard, so I wonder if
that could be part of the problem.

Any ideas?

Thanks...Brad

Mime
View raw message