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).