You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by André Augusto de Oliveira Aragão <an...@ca.tco.net.br> on 2003/04/04 18:12:46 UTC

NTLM Authentication Error

HI!

I'm trying to access a ntlm authenticated server, but it´s not working. The
logs are returning the following: 
[HttpMethod] Already tried to authenticate to "tconet#null" but still
receiving 401.

Here´s my code:

HttpClient client = new HttpClient();
client.setConnectionTimeout(60000);
client.getState().setCredentials(
       "tconet",
        new
NTCredentials("Andre.Augusto","senha","ca_andreaugusto","CACEL01")
);
String url = "http://tconet/index.asp";
GetMethod method = new GetMethod(url);
method.setFollowRedirects(true);
method.setStrictMode(false);
method.setDoAuthentication(true);
logger.info("Trying to reach " + url);
String responseBody = null;
long tempoinicial = System.currentTimeMillis();
long tempogasto = 0;
try {
  int retorno = client.executeMethod(method);
  ...
  ...

Thanks in advance,

Andre Augusto