Hi,
I am trying to implement NTLM proxy authentication in my application. The implementation for Basic and Digest schemes has been pretty straight forward.
For Basic,
-------------
URL url = new URL("http://java.sun.com");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestProperty("Proxy-Authenticate", "Basic realm="+ realmName);
String authentication = new sun.misc.BASE64Encoder().encode( (uname + ":"+ pwd).getBytes() );
con.setRequestProperty("Proxy-Authorization", "Basic "+ authentication );
similarly I could implement for Digest mechanism.
I have problem implementing it for NTLM authentication mechanism for Proxy. If a page in the server is protected using NTLM scheme, Internet Explorer will present a dialog to enter username, password and domain(if user belongs to different domain) to get access to the resource on the server.
I have requirment to implement the same in my
java application using HTTP Connection. I have no idea how to set the domain, username and pwd in the connection object. I found some information on NTLM at
http://davenport.sourceforge.net/ntlm.html which provides with an example in the bottom of the page. But, I did not understand how to set Type 1, Type 2 and Type 3 messages in the connection object.
I appreciate if somebody can help me out ASAP.
Thanks in advance.