Page 1 sur 1

Lotus web app Connect to LDAP using java Agent

MessagePublié: 01 Oct 2013 à 14:33
par Aniss
Bonjour

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

Re: Lotus web app Connect to LDAP using java Agent

MessagePublié: 01 Oct 2013 à 14:39
par Michael DELIQUE
salut

c'est normal ! ton agent n'affiche pas de HTML ou ne renvois pas sur une page donc il est lancé et a la fin domino affiche une page pour dire c'est finis !

mais entre temps ton agent a tourné

Re: Lotus web app Connect to LDAP using java Agent

MessagePublié: 01 Oct 2013 à 15:00
par Aniss
tout à fait d'accord avec vous, mais pour quoi il m'affiche le message "Start Connection" et ne pas "OK Connected" ;

merci

Re: Lotus web app Connect to LDAP using java Agent

MessagePublié: 01 Oct 2013 à 15:02
par Michael DELIQUE
en client lourd, l'agent tourne sur ton poste et il y a tout ce qu'il faut pour ce connecter.

en web, l'agent tourne sur le server et ton server dois pas avoir ce qu'il faut. faut installer les connecteurs.

Re: Lotus web app Connect to LDAP using java Agent

MessagePublié: 01 Oct 2013 à 15:17
par Aniss
je vois, Savez-vous par hasard commet installer les connecteurs

merci