openLDAP样本

时间:2011-02-24 07:05:20

标签: ldap

我想探索openLDAP ..任何人都可以向我推荐一些简单的ldap代码网站吗?

2 个答案:

答案 0 :(得分:2)

如果您正在寻找Java库,有多种选择

答案 1 :(得分:1)

如果你想探索什么是LDAP。你可以去找389 Directory Server(Open LDAP) 请参阅下面的链接。安装它。它有管理GUI。

  

http://directory.fedoraproject.org/wiki/Main_Page

对于JNDI,要打电话,您可以参考下面的网站和代码连接LDAP服务器

  

http://docs.oracle.com/javase/jndi/tutorial/ldap/models/operations.html

                Hashtable<String, String> env = new Hashtable<String, String>();
                env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
                env.put(Context.PROVIDER_URL, providerUrl);
                env.put(Context.SECURITY_PRINCIPAL, UserContextBean.getEntrydn());
                env.put(Context.SECURITY_CREDENTIALS, password);
                env.put(Context.SECURITY_AUTHENTICATION, authenticationType);
                LDAPContext ctx = new InitialLdapContext(env, null);

此ctx可用于访问目录。