Java version of ldap-auth