Skip to content

Provide a way to search in multiple base DNs #636

Open
@goto1134

Description

@goto1134

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions