Using NTLM authentication in Java applications

Out of the above list, only ntlmv2-auth and Jespa support NTLMv2. Jespa is workable but commercial. ntlmv2-auth I haven’t tried but it’s based on the code from Liferay, which I’ve seen working before.

‘ntlm-authentication-in-java’ is only NTLMv1, which is old, insecure, and works in a dwindling number of environments as people upgrade to newer Windows versions. JCIFS used to have an NTLMv1 HTTP auth filter, but it was removed in later versions, as the way it was implemented amounts to a man-in-the-middle attack on the insecure protocol. (The same appears to be true of ‘ntlm-authentication-in-java’.)

The ‘spnego’ project is Kerberos not NTLM. If you want to replicate full IWA as IIS does it, you’d need to support both NTLMv2 and Kerberos (‘NTLM’ auth, ‘Negotiate’ auth, NTLMSSP-in-SPNego auth and NTLM-masquerading-as-Negotiate auth).

Leave a Comment