import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
Hashtable env= new Hashtable(11);
env.put(Context.SECURITY_PRINCIPAL,"CN=kiran,OU=LinkedgeOU,DC=LINKEDGEDOMAIN"); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://
env.put(Context.SECURITY_AUTHENTICATION, "simple");
//username
env.put(Context.SECURITY_PRINCIPAL,
//password
env.put(Context.SECURITY_CREDENTIALS, password);
try {
DirContext ctx = new InitialDirContext(env);
String[] sAttrIDs = new String[2];
Attributes attr = ctx.getAttributes("");
NamingEnumeration
}
catch(NamingException e){
System.err.println("Problem getting attribute: " + e);
}
venerdì 10 aprile 2009
Autenticazione su LDAP tramite Active Directory
Etichette: Active Directory, LDAP
Iscriviti a:
Commenti sul post (Atom)
Nessun commento:
Posta un commento