Open
Description
In my ldap the users are located in DN=(ou=users,dc=example,dc=com)
, and service accounts in DN=(ou=sa,dc=example,dc=com)
. The size of LDAP is huge and it is crucial to limit the search scope to these org. units.
But I have the same entity to be retrieved from these ous:
@Entry(objectClasses = ["top", "person", "user"])
class LdapUser {
@Id
lateinit var id: Name
@Attribute(name = "objectGUID", type = Attribute.Type.BINARY)
lateinit var objectGUID: ByteArray
}
Therefore I have to perform the following code to search for the only record by objectGUID:
val ldapUser = ldapTemplate.find(
query().base("ou=users").filter(guidFilter),
LdapUser::class.java
).firstOrNull() ?: ldapTemplate.find(
query().base("ou=sa").filter(guidFilter),
LdapUser::class.java
).firstOrNull()
Please, provide a way to search multiple organizational units in one query.