If I am going to add a user to an existing LDAP using the JNDI API, what should I provide as the "name" argument for javax.naming.DirContext#bind(String name, Object obj, Attributes attrs)? Should it be the dn of the object or the dn of the context that object should be added to? Something else?
Right now (while prototyping against a mocked-up implementation of DirContext and not having access to a real LDAP server), I'm doing something like this:
It seems a bit stupid giving out first the object itself and then the object's attributes (which the DirContext implementation could easily pick up from the object itself if it implements the appropriate interfaces).
Lasse, I once(3years back) used Netscape LDAP directory server 4.12 with JNDI to add/access/delete new user information, i used there sample tutorials provided in their site and modified them a little to suite my needs!..
Thanks for the tip. I gave up on OpenLDAP -- it's too geeky (pure command-line with cryptic error messages) for me to learn in a couple of hours so I downloaded an evaluation version of Sun's directory server earlier today (that's what the production environment will be using but I was hoping for a more lightweight product for testing during development). Well, it doesn't look like a resource hog so I guess I'll be fine.