1 2 3 4 5 6 7 8 9 10 11 12
| public void connection (String credentials, String principal, String url, String authentication) throws ch.esnig.ldap.ClientLDAPException {
try {
Hashtable<String,String> env = new Hashtable<String,String>();
prop.put (Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
prop.put (Context.PROVIDER_URL, url);
prop.put (Context.SECURITY_AUTHENTICATION, authentication);
prop.put (Context.SECURITY_PRINCIPAL, uid);
prop.put (Context.SECURITY_CREDENTIALS, credentials);
ctx = new InitialDirContext(prop);
...
... |