Hi Dilshan,
I have a similar issue where URL works fine via browser but fails from JAVA client when web server is IIS with NTLM authentication. Did you find any solution for this problem? Thanks in advance, Milind Dilshan Edirisuriya-2 wrote: > > Hi , > > I have a web page that need to access with NTLM authentication on my local > machine and i can see the expected behavior with Web browsers. But when I > try to access same page using HTTPClient 4.1 I'm getting following > exception. > > > Apr 17, 2011 7:18:23 PM > org.apache.http.client.protocol.RequestTargetAuthentication process > SEVERE: Authentication error: Invalid name provided (Mechanism level: > Could > not load configuration file C:\Windows\krb5.ini (The system cannot find > the > file specified)) > Status :: HTTP/1.1 401 Unauthorized > > > This is my sample code and it exactly same as example given in here > http://hc.apache.org/httpcomponents-client-ga/tutorial/html/authentication.html#ntlm > > DefaultHttpClient httpclient = new DefaultHttpClient(); > > NTCredentials creds = new NTCredentials("user", "pwd", "machin-name", > "machin-name"); > httpclient.getCredentialsProvider().setCredentials(AuthScope.ANY, > creds); > > Host target = new HttpHost("localhost", 9090, "http"); > HttpContext localContext = new BasicHttpContext(); > > // Execute a cheap method first. This will trigger NTLM authentication > HttpGet httpget = new HttpGet("/hello1"); > HttpResponse response = httpclient.execute(target, httpget, > localContext); > HttpEntity entity = response.getEntity(); > System.out.println(" Status :: "+ response.getStatusLine()); > > > Further analyzing i found there is no 'Authorization:" header in > outgoing > messages where this header is available with browser access. Please note > that I used same name/password/Domain for browser access too. > > Appreciate for any help to resolve this ? > > Thank you , > > Dilshan > > -- View this message in context: http://old.nabble.com/Issues-accessing-NTLM-server-using-HTTPClient-4.1-tp31417743p32848479.html Sent from the HttpClient-User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
