Support referrals in LDAP searches

Per https://gitlab.zendesk.com/agent/tickets/56047

Currently, any time we use LDAP searches, responses that include a referral are ignored. This happens in in Gitlab::LDAP::Adapter#search

Here's the search method for the underlying LDAP instance: http://www.rubydoc.info/gems/net-ldap/Net/LDAP/Connection#search-instance_method

It expects to receive return_referrals: true and/or deref: Net::LDAP::DerefAliases_Always before it will return anything but nil when a referral is given, and we aren't passing those values.

Can we rely on dereferencing support in the servers? Or should we handle the referrals ourselves, explicitly?

Current known use case: our customer is attempting to use a user_filter that is returning referrals.

/cc @dblessing

Edited Jun 18, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading