
This dialog appears when I try to login from web browser (IE, Chromw, Etc).
Using Apache httpclient library try to auto-login.
way 1. http://userid:pass@hostname (X)
way 2. Using Apache HttpClient QuickStart Example (X)
All of the above methods does not work.
Please Help me.
Lastest Try Code
DefaultHttpClient httpClient = new DefaultHttpClient();
try{
httpClient.getCredentialsProvider()
.setCredentials(new AuthScope(
new HttpHost(host)),
new UsernamePasswordCredentials(username, password));
HttpGet httpget = new HttpGet(host);
System.out.println("executing request" + httpget.getRequestLine());
HttpResponse response = httpClient.execute(httpget);
HttpEntity entity = response.getEntity();
System.out.println("----------------------------------------");
System.out.println(response.getStatusLine());
if (entity != null) {
System.out.println("Response content length: " + entity.getContentLength());
}
EntityUtils.consume(entity);
} finally {
// When HttpClient instance is no longer needed,
// shut down the connection manager to ensure
// immediate deallocation of all system resources
httpClient.getConnectionManager().shutdown();
}
Console window says:
'executing requestGET http://192.168.100.129/tag/unsubscribe HTTP/1.1'
'----------------------------------------'
'HTTP/1.0 401 Unauthorized'
'Response content length: 0'