This article highlights the configuration setup required to add new users to external user directories using Command Line Interface(CLI).
To add new users to the external LDAP directory through CLI, you must have the below configuration in place, i.e.:
Ensure that your external LDAP directory is listed at the top order of User Directories.
- If the directory type is Microsoft Active Directory or LDAP, configure with both permissions (i.e Modifying users, groups and memberships in Jira/Confluence causes the changes to be applied directly to your LDAP server. Your configured LDAP user must have modification permissions on your LDAP server.)
- If the directory type is Delegated LDAP Authentication, Jira/Confluence can use LDAP for user authentication only. To be able to log in to Jira/Confluence with this configuration:
- users must either be created first in Jira/Confluence or
- the option 'Copy User on First Login' can be selected to automatically add them to JIRA/Confluence’s internal directory.
Copied users can subsequently be modified in Jira/Confluence, but modifications are not reflected on the LDAP server.
Groups and memberships from the LDAP server are not used. However, users from LDAP can be added to groups maintained in Jira/Confluence’s internal directory.
Once the mentioned configuration is in place,
- Create a test user from Jira/Confluence GUI and validate if it’s added to the External LDAP directory.
- Perform the CLI action addUser to create a new user and this creates a new user as per the in the configured user directories.
--action addUser --userId "testuser1" --userFullName "Test User1" --userEmail "email@example.com" --continue --userPassword "userPassword1"