cercando soluzioni su ldap ho trovato questo 3d senza risposta...
ho risolto e posto la soluzione sperando possa servire ad altri utenti
codice:
public boolean userVerify(String user, String password){
boolean userVerify = false;
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://tuoindirizzo:porta");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "CN=" + user + ",conn");
env.put(Context.SECURITY_CREDENTIALS, password);
try {
DirContext authContext = new InitialDirContext(env);
userVerify = true;
authContext.close();
} catch (AuthenticationException authEx) {
//System.out.println("Authentication failed!");
userVerify = false;
} catch (NamingException namEx) {
//System.out.println("Something went wrong!");
userVerify = false;
}
return userVerify;
}