I'm talking about this part:
BTW, if I try to hack it temporarily and accept the search result as a LDAP\ResultEntry object, I am able to successfully authenticate (the problem was when it was trying to retrieve the DN from the search result).
I'm curious to see what you did to authenticate successfully.
Cheers.