I'm using the UnboundID LDAP Java SDK to connect a Groovy/Grails application to Active Directory. Here are the connection options that I'm using:
LDAPConnectionOptions options = new LDAPConnectionOptions()
options.connectTimeoutMillis = 60000 // 1 minute
options.followReferrals = true
options.referralHopLimit = 10
options.responseTimeoutMillis = 60000 // 1 minute
options.useSynchronousMode = true
However, I still keep getting LDAPSearchExceptions with result code 10, which means that the server sent a referral. Changing the referralHopLimit to a higher number doesn't help, so clearly the library isn't following the referrals.
So far I seem to only get this issue when using the LDAPConnection.getEntry method to load a specific entry specified by a DN. I haven't yet received it when performing a search. So I'm wondering if maybe the getEntry method isn't supposed to follow referrals and if that's the case, what's the best approach for manually following referrals or changing it's behavior?