j'utilise dans mon application l'autothentification via LDAP
dans mon code java j'utilise le package javax.naming
comment je peux vérifier si l'utilisateur "username" existe dans Ldap ou non
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 Hashtable env = new Hashtable(); try { env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL,url_ldap); env.put(Context.SECURITY_PRINCIPAL, username + "@" + domaine); InitialDirContext ctx = new InitialDirContext(env); }
merci
Partager