# Re: Search-result referrals in Net::LDAP

**URL:** <https://www.ruby-forum.com/t/re-search-result-referrals-in-net-ldap/95395>\
**Category:** Ruby\
**Created:** [May 31, 2006, 3:45am UTC](https://www.ruby-forum.com/t/re-search-result-referrals-in-net-ldap/95395 "2006-05-31T03:45:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeSSSSaS\_Botp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecd19e/32.png) [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Post date:** [May 31, 2006, 3:45am UTC](https://www.ruby-forum.com/t/re-search-result-referrals-in-net-ldap/95395/1 "2006-05-31T03:45:56Z")

</div>

fr Francis:

# This happens because many A/D servers are configured to

# return what LDAP

# calls “Search-result referrals”- an additional LDAP URL that you are

# encouraged to query in order to get additional relevant results. The

# Net::LDAP library was not supporting this result-type. I’m in

# the process of adding it in now and will produce a patch shortly.

# Has anyone else encountered this problem?

if you care to show us the script, i will also test it here.  
thanks and kind regards -botp

---

<div class="post-metadata">

**Author:** ![PeSSSSaS\_Botp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecd19e/32.png) [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Post date:** [May 31, 2006, 10:41am UTC](https://www.ruby-forum.com/t/re-search-result-referrals-in-net-ldap/95395/2 "2006-05-31T10:41:18Z")

</div>

Botp, it was only a few minutes’ work to handle referrals at the  
LDAP-protocol level. The problem I’m having is at the API level. A  
search-referral is returned as a search result, like any other, except  
of  
course that it’s different: it has no attribute-value pairs, and  
consists of  
a sequence of LDAP URIs. My first thought was just to add a method to  
Net::LDAP::Entry and let user code figure it out. But I don’t think you  
want  
to add entry.is\_search\_referral? to every one of your search-result  
handlers! So I’m trying to think of a better way to surface the referral  
to  
user code. Do you have any ideas?
