docs/system-admin-guide/authentication/ldap-connections/ldap-department-synchronization/README.md
[feature: ldap_groups ]
In OpenProject Enterprise edition, you can mirror the organizational unit (OU) structure of your LDAP or Active Directory into the OpenProject organization: each OU below a configured base DN becomes a department, and users are assigned to the department of the OU they reside in. This guide assumes that you:
[!NOTE] This feature is available for both Enterprise cloud and Enterprise on-premises. When using Enterprise cloud, your LDAP server must be reachable from the OpenProject cloud infrastructure, which typically means exposing it to the internet, which is not recommended. This is a network and security consideration for your organization to evaluate. Consider using SAML or SCIM provisioning as a more secure alternative.
For the sake of simplicity, we assume that in this guide your LDAP structure looks like the following, with ou=org,dc=example,dc=com as the subtree you want to synchronize:
Synchronizing this subtree results in the following department hierarchy in OpenProject, with jdoe assigned to IT / Development / Frontend, bsmith to IT / Development / Backend and hwest to Human Resources / Recruiting:
IT
├── Development
│ ├── Frontend
│ └── Backend
└── Support
Human Resources
├── Recruiting
└── Support
Note that the base DN itself is only the anchor of the synchronization and does not become a department. Its direct child OUs become top-level departments, deeper OUs are nested accordingly.
To access the LDAP department synchronization administration pane, expand the LDAP authentication menu item in your administration.
Unlike group synchronization, departments are never mapped one by one. You always configure a subtree, and OpenProject discovers the organizational units within it.
To create a new synchronization, use the + Add LDAP department synchronization button on the top right of the index page. The form will open, where you can specify the following:
ou=org,dc=example,dc=com. It must be within the base DN of the selected LDAP connection, and it may not overlap the base DN of another synchronization on the same LDAP connection.(objectClass=organizationalUnit).ou.objectGUID (Active Directory) or entryUUID (OpenLDAP). When set, departments survive renames and moves of their OU. Leave empty to match OUs by DN.(objectClass=person) filter when the connection does not define one.Click on Create to finish the creation of the synchronization. A first synchronization is started in the background immediately, and the department hierarchy and its members are synchronized every 30 minutes afterwards through a background job.
Each run consists of two steps:
LDAP is authoritative for the memberships it manages. A user can only belong to one department, so a user found below a different OU than before is moved: they are removed from their previous department and added to the new one. Memberships that the synchronization no longer sees in LDAP are removed as well.
To trigger a synchronization manually (OU discovery and member sync), use the Synchronize organizational units button on the detail page of a synchronization, or run the following rake task in a console:
bundle exec rake ldap_departments:synchronize
The rake task synchronizes all configured trees, the button only the one you are looking at.
The detail page of a synchronization lists all departments it currently manages, with their full path, the DN of the OU they were created from, and their member count. The departments themselves are managed under Administration → Users and permissions → Organization, where they are marked as Managed by LDAP synchronization.
Because the synchronization owns them, managed departments are read-only in that administration section:
To edit a department manually again, stop managing it as described below.
Departments and their members are never deleted by removing a mapping — they only stop being managed and become regular departments that you can edit or delete manually.
If an OU disappears from your LDAP (or no longer matches the organizational unit filter), OpenProject drops the mapping automatically during the next run. The department and its members are kept as an unmanaged department.
Yes. Organizational units are synchronized at any depth below the base DN and are nested accordingly in the OpenProject department hierarchy.
Users, however, are only assigned to the department of the OU they reside in directly. A user entry that is not a direct child of a synchronized OU is not assigned to any department.
Yes, you can create as many synchronizations as you need, also against different LDAP connections. Two synchronizations on the same LDAP connection may not overlap, though: neither base DN may be an ancestor of, or identical to, the other, since the same OU cannot be claimed by two synchronizations.
If you configured a Unique identifier attribute, the OU is matched by that identifier and the existing department is renamed or re-nested accordingly.
Without it, OUs are matched by DN: the renamed or moved OU is treated as a new one, and the department of the old DN is unmanaged (but kept). We therefore recommend setting the unique identifier attribute whenever your directory provides one.
Yes. Departments and groups are separate concepts in OpenProject, and both synchronizations are independent of each other. Users can be a member of any number of groups while belonging to exactly one department.
ldapsearch. If your directory models departments with a different object class than organizationalUnit, adjust the filter accordingly.For users to be assigned to departments, the following conditions need to be met:
ou=people branch) cannot be assigned, as their parent entry is not a department.(objectClass=person). Verify it with ldapsearch if in doubt.The department is derived from the OU the user entry resides in, and LDAP takes precedence over manual assignments. If a user was assigned to a department manually before, the synchronization moves them to the department of their OU on the next run.
Note that this also applies in reverse: as long as a user belongs to a managed department, they cannot be moved to another department manually.