[Rt-commit] rt branch, 4.4/log-ldap-result-count, created. rt-4.4.4-60-g6233de948

Jim Brandt jbrandt at bestpractical.com
Tue Aug 27 09:04:27 EDT 2019


The branch, 4.4/log-ldap-result-count has been created
        at  6233de948f0331855eba8c0fd40c5edb836107b2 (commit)

- Log -----------------------------------------------------------------
commit 6233de948f0331855eba8c0fd40c5edb836107b2
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Tue Aug 27 09:01:59 2019 -0400

    Log number of records returned from LDAP search
    
    ExternalAuth requires a single result from an LDAP search
    to use the returned data to populate a user record. Since it
    will stop processing and move on to other configured auth
    sources, log the number of entries returned to make it clear
    why that user was skipped even though records were found.

diff --git a/lib/RT/Authen/ExternalAuth/LDAP.pm b/lib/RT/Authen/ExternalAuth/LDAP.pm
index 2cc53f713..1ed3a1782 100644
--- a/lib/RT/Authen/ExternalAuth/LDAP.pm
+++ b/lib/RT/Authen/ExternalAuth/LDAP.pm
@@ -451,6 +451,7 @@ sub CanonicalizeUserInfo {
         # If there's only one match, we're good; more than one and
         # we don't know which is the right one so we skip it.
         if ($ldap_msg->count == 1) {
+            RT->Logger->debug("Found one matching record");
             my $entry = $ldap_msg->first_entry();
             foreach my $key (keys(%{$config->{'attr_map'}})) {
                 # XXX TODO: This legacy code wants to be removed since modern
@@ -496,6 +497,8 @@ sub CanonicalizeUserInfo {
             $found = 1;
         } else {
             # Drop out to the next external information service
+            RT->Logger->debug("Found " . $ldap_msg->count . " records. Need a single matching record"
+                . " to populate user data, so continuing with other configured auth services."
             $ldap_msg = $ldap->unbind();
             if ($ldap_msg->code != LDAP_SUCCESS) {
                 $RT::Logger->critical(  (caller(0))[3],

-----------------------------------------------------------------------


More information about the rt-commit mailing list