May I ask how do I set up an Authentication for Digest MD5 on my Windows Server 2012 active directory to allow the client to authenticate to the server. Here is the code I am using to establish the connection from the client to the server.
Hashtable env = new Hashtable()
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory")
env.put(Context.SECURITY_AUTHENTICATION,"DIGEST-MD5 CRAM-MD5")
env.put(Context.SECURITY_PROTOCOL,"ssl")
env.put(Context.PROVIDER_URL,"ldap://test.com:636/") //The Window Server Address
env.put(Context.SECURITY_PRINCIPAL,"CN=DemoUser,OU=test,DC=test,DC=com")
env.put(Context.SECURITY_CREDENTIALS,"thepasswordishere")
try {
def ctx = new InitialDirContext(env)
if (ctx) {
println "Authentication Success"
}
}catch(AuthenticationException elc){
println elc.printStackTrace()
println "Authentication Fail"
}catch(Exception e){
println e.printStackTrace()
}
ctx.close()