Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/02/2016, 16:33
AldoRJ
 
Fecha de Ingreso: febrero-2016
Mensajes: 2
Antigüedad: 8 años, 2 meses
Puntos: 0
Autenticacion LDAP con AngularJS

Hola. me gustaria saber si puedo hacer la autentificacion LDAP en angularjs
quiero hacer algo como esto pero en angularjs

public class Authentication {

public boolean validar(String whoiswho, String password) throws Exception {
try { //clase que valida un usuario
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.PROVIDER_URL, "ldap://172.16.1.1"); //ip del servidor
env.put(Context.SECURITY_PRINCIPAL, "TECLABLET\\" + whoiswho); //who is who del usuario
env.put(Context.SECURITY_CREDENTIALS, password); //contraseña del usuario
DirContext ctx;
ctx = new InitialDirContext(env);

return true; //regresa, en caso de estar correcto un true
} catch (NamingException e) {
return false; //en caso de un error o estar incorrecto regresa false
}
}
}