[Rt-commit] rt branch, 4.4/log-ldap-result-count, created. rt-4.4.4-60-gac04f3b68
Jim Brandt
jbrandt at bestpractical.com
Thu Sep 19 15:25:28 EDT 2019
The branch, 4.4/log-ldap-result-count has been created
at ac04f3b68f2bcf75a95d628e5c8a3edab0174df5 (commit)
- Log -----------------------------------------------------------------
commit ac04f3b68f2bcf75a95d628e5c8a3edab0174df5
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..21c47383c 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