开发者

How to add and delete user to OpenDS using Java?

开发者 https://www.devze.com 2023-03-28 23:00 出处:网络
I want to add and delete users from an OpenDS server, can someone please provide some sample code?I could not find开发者_运维技巧 it anywhere, including the OpenDS wiki.The ldapmodify command has the

I want to add and delete users from an OpenDS server, can someone please provide some sample code? I could not find开发者_运维技巧 it anywhere, including the OpenDS wiki.


The ldapmodify command has the ability to add and delete users. Try checking out the OpenDS source code and reviewing the implementation of the ldapmodify program for an example.


If you are open to using the GUI, here's how to add admin users: https://docs.opends.org/2.2/page/ManagingUsersWithControlpanel.

If you are open to using Spring, here's a pretty comprehensive example: http://blog.javachap.com/index.php/ldap-user-management-with-spring-ldap/.

If you are using OpenSSO (a sister project to OpenDS), you can use the OpenSSO REST interfaces to admin users.


The UnboundID LDAP SDK provides examples of add, delete, modify, and modify DN operations against an LDAP directory server in the com.unboundid.ldap.sdk.examples package, LDAPModify class.


If you want to use Java to Add and Delete users in OpenDS, you can use JNDI or OpenDJ LDAP SDK (or any other LDAP client api). JNDI is bundle in the JVM and you can find detailed tutorials on Java.sun.com. The OpenDJ LDAP SDK is an external library, has lots of sample code and docs on opendj.forgerock.org. You just need to point to the Maven repository to make use of it.

As Aaron mentioned, Apache Directory Studio is an LDAP GUI built in Eclipse and it works very well with OpenDS and its continuation : OpenDJ.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号