Android NTLM authenication made easy

If your android application use any internet resource like a API call or SOAP call ,  behind a corporate proxy you might get a authentication failed message. The issue is because the proxy server is using an authentication mechanism to restrict access. Usually proxies support basic authentication then you can get around with android builtin classes see the sample code

 

If incase the proxy doesnt support basic authentication and do have NTLM authentication support ( Mostly ISA proxy) you cannot get the authentication to work as easy as before. I have been reading some details on ntlm and few open source implementation of it. I came accross jcif library and found few usefull classes and added few android specific helper classes to make a tiny library.

With the library NTLM authentication is made very simple. Only thing you need to know is you domain name , username and password,Proxy server details if any, add the library to your build path and use NTLM class in net.maxters.ntlm package. Use the static method setNTLM with desired HttpClient and authentication parameters.

few variation of the method is also include where you can explicitly specify the scope, user credentials, proxy details, etc. Methods are

Continue reading Android NTLM authenication made easy