The addUserData method (syntax 1)
- Organization of this page
Description
Adds a user. If the user already exists, an exception occurs.
The attribute (uid) and value of the user ID are used for the DN of a user entry created on the LDAP directory server.
The user entry is created immediately below the base DN. If the user attribute information specified by the constructor includes the attributes of a subcontext, an entry for the subcontext is also created.
If an exception occurs during the subcontext update after this method is called, user information is incompletely updated. In such case, remove the cause and use the removeUserData method to delete the user, and then call this method again.
Syntax
public void addUserData(String uid,
UserData UserData)
throws ObjectClassError, NamingException;
Parameters
- uid:
-
Specifies the user ID.
- userData:
-
Specifies the UserData object that holds the user information.
Exceptions
- com.cosminexus.admin.auth.api.repository.ldap.ObjectClassError:
-
An object class necessary for creating an entry on the LDAP directory server is not specified.
- javax.naming.CommunicationException:
-
An attempt to connect to the LDAP directory server has failed.
- javax.naming.NameAlreadyBoundException:
-
The specified user ID already exists.
- Other JNDI exceptions:
-
Events such as a bind DN specification error
Return value
None
Remarks
UserData objects acquired using the getUserData method do not contain passwords. If you specify such a UserData object in the parameters of the addUserData method, you cannot make a complete copy of the user. You need to newly configure a password.