Lotus web app Connect to LDAP using java Agent
Bonjour
j'utilise un agent java pour se connecter a un serveur active directory
quand j'exécute l'agent en web en cliquant sur un bouton , il m'affiche "Start Connection" et après le masque disparue et affiche "Agent exécuté" dans touts la page , c'est tout
NB : l'agent marche très bien en client lourd
j'utilise un agent java pour se connecter a un serveur active directory
- Code : Tout sélectionner
public static DirContext LdapConnect(String ldapHote , String port , String dn , String password ) {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put("com.sun.jndi.ldap.connect.timeout", "5000");
env.put(Context.PROVIDER_URL, "ldap://"+ldapHote+":"+port+"");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL,dn);
env.put(Context.SECURITY_CREDENTIALS,password);
DirContext dirContext = null;
try {
JOptionPane.showMessageDialog(null, "Start Connection");
dirContext = new InitialDirContext(env);
JOptionPane.showMessageDialog(null, "OK Connected");
return dirContext;
} catch (Exception e) {
System.err.println("Erreur lors de l'acces au serveur LDAP" + e);
System.out.println("NON Connected");
e.printStackTrace();
}
return null;
}
quand j'exécute l'agent en web en cliquant sur un bouton , il m'affiche "Start Connection" et après le masque disparue et affiche "Agent exécuté" dans touts la page , c'est tout
NB : l'agent marche très bien en client lourd