I have an application that requires authentication.  I user a timer to
schedule a task that will access the same application through httpClient.  I
am surprised to see the following statement did pass the authentication: 

client.getState().setCredentials (null,new UsernamePasswordCredentials());

1. Can anybody explain why?  
2. I did a little experiement - if I don't call authenticate(), then the
client.executeMethod(new PostMethod(http://myapp.com/myapp)) will fail
becaue no credentials available for realm x at host xxx.  However, if I call
authenticate(), even to authenticate empty credential with null realm, I get
pass for the next client.executeMethod(...).  
Why can I get authenticated on realm x while I only did authentication for
null??

Thanks

Jing

Reply via email to