Currently, I'm using user and password as the connection credentials to ldap (in order to authenticate user of AD).
For authentication here I had created an initial context (for Active Directory) by using the InitialDirContext, where we supply a set of environment properties, which would be containing authentication information.
My code looks like:
env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, ...);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, ...);
env.put(Context.SECURITY_CREDENTIALS, ...);
env.put("com.sun.jndi.ldap.connect.timeout", ...);
try {
ctx = new InitialLdapContext(env);
}
catch (NamingException e) {
System.out.println("error")
}
I want to change this code, so it will authenticate entered user name and password as the credentials against the LDAP using NTLM.
Can you provide me any example?
NTLM – is a suite of Microsoft security protocol that provide - Authentication - Integrity - Confidentiality