This question about LDAP: Asked

can not authenticate on Active Directory but LdapNgPlugin works ok

I try to authenticate and authorize users against an active directory in order to create a documentation server for a small business. I you have any idea where to search I welcome any suggestion wink

I activated the logs, here's an example of failed authentication in /var/log/apache2/foswiki/error.log and I get a "dn not found"

[Mon Sep 03 19:05:00.937919 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: - LdapContrib - cacheAge=9999999999, maxCacheAge=86400, lastUpdate=0, refresh=1, referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.937980 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: - LdapContrib - WARNING: already refreshing cache, referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.937989 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: SESSION ?: loadSession, referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.938011 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: SESSION ?(c): Cookie FOSWIKISID=9f9c54110adaa9362aecda5402aac647; FOSWIKISTRIKEONE=c2de792073e06a744edb02648ec6d42f, referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.938029 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: SESSION ?(c): ... Found session id 9f9c54110adaa9362aecda5402aac647;, referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.938037 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: SESSION ?(c): _loadCreateCGISession called ..., referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.938044 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: SESSION 9f9c54110adaa9362aecda5402aac647(c): No session, checking URI Params for a user, referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.938051 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: SESSION 9f9c54110adaa9362aecda, referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.938307 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: 5402aac647(c): Falling back to DEFAULT USER: guest, referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.938330 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: SESSION 9f9c54110adaa9362aecda5402aac647(c): userLoggedIn called with guest - undef, referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.938340 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: SESSION 9f9c54110adaa9362aecda5402aac647(c): == Initial user is guest, referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.938348 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: SESSION 9f9c54110adaa9362aecda5402aac647(c): Session is NOT authenticated, referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.938356 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: SESSION 9f9c54110adaa9362aecda5402aac647(c): Setting internal preference VALID_ACTIONS to HASH(0x55a3ed91f160), referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.938364 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: SESSION 9f9c54110adaa9362aecda5402aac647(c): Setting internal preference FOSWIKISTRIKEONE to c2de792073e06a744, referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.969930 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: edb02648ec6d42f, referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.969957 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: SESSION 9f9c54110adaa9362aecda5402aac647(c): Setting internal preference REMEMBER to null, referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.969966 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: - LdapPasswdUser - called checkPassword(foswiki, passU), referer: http://10.0.8.20/bin/login
[Mon Sep 03 19:05:00.969986 2018] [fcgid:warn] [pid 120:tid 140074083661568] [client 192.168.10.209:60312] mod_fcgid: stderr: - LdapPasswdUser - dn not found, referer: http://10.0.8.20/bin/login

here's my configuration file grep -i ldap ./LocalSite.cfg

$Foswiki::cfg{Ldap}{AllowChangePassword} = 0;
$Foswiki::cfg{Ldap}{Base} = 'DC=mydomain,DC=com';
$Foswiki::cfg{Ldap}{BindDN} = 'CN=foswikireaduser,DC=mydomain,DC=com';
$Foswiki::cfg{Ldap}{BindPassword} = '************';
$Foswiki::cfg{Ldap}{CaseSensitiveLogin} = 0;
$Foswiki::cfg{Ldap}{CharSet} = 'utf-8';
$Foswiki::cfg{Ldap}{Debug} = 1;
$Foswiki::cfg{Ldap}{DefaultCacheExpire} = '20';
$Foswiki::cfg{Ldap}{Exclude} = 'WikiGuest, ProjectContributor, RegistrationAgent, UnknownUser, AdminGroup, NobodyGroup, AdminUser, admin, guest';
$Foswiki::cfg{Ldap}{GroupAttribute} = 'cn';
$Foswiki::cfg{Ldap}{GroupBase} = [
'DC=mydomain,DC=com'
];
$Foswiki::cfg{Ldap}{GroupFilter} = 'objectClass=group';
$Foswiki::cfg{Ldap}{GroupScope} = 'sub';
$Foswiki::cfg{Ldap}{Host} = 'ActiveDirectory_ip_address';
$Foswiki::cfg{Ldap}{IPv6} = 0;
$Foswiki::cfg{Ldap}{IgnorePrivateGroups} = 1;
$Foswiki::cfg{Ldap}{IgnoreReferrals} = 0;
$Foswiki::cfg{Ldap}{IgnoreViewRightsInSearch} = 0;
$Foswiki::cfg{Ldap}{IndexEmails} = 1;
$Foswiki::cfg{Ldap}{InnerGroupAttribute} = 'memberOf';
$Foswiki::cfg{Ldap}{KerberosKeyTab} = '';
$Foswiki::cfg{Ldap}{LoginAttribute} = 'sAMAccountName';
$Foswiki::cfg{Ldap}{LoginFilter} = 'objectClass=user';
$Foswiki::cfg{Ldap}{MailAttribute} = 'mail';
$Foswiki::cfg{Ldap}{MapGroups} = 1;
$Foswiki::cfg{Ldap}{MaxCacheAge} = '86400';
$Foswiki::cfg{Ldap}{MemberAttribute} = 'member';
$Foswiki::cfg{Ldap}{MemberIndirection} = 1;
$Foswiki::cfg{Ldap}{MergeGroups} = 0;
$Foswiki::cfg{Ldap}{NormalizeGroupNames} = 1;
$Foswiki::cfg{Ldap}{NormalizeLoginNames} = 1;
$Foswiki::cfg{Ldap}{NormalizeWikiNames} = 1;
$Foswiki::cfg{Ldap}{PageSize} = '500';
$Foswiki::cfg{Ldap}{PersonAttribures} = {
$Foswiki::cfg{Ldap}{PersonDataForm} = 'UserForm';
$Foswiki::cfg{Ldap}{Port} = 389;
$Foswiki::cfg{Ldap}{Precache} = 1;
$Foswiki::cfg{Ldap}{PreferLocalSettings} = 0;
$Foswiki::cfg{Ldap}{PrimaryGroupAttribute} = 'primaryGroupID';
$Foswiki::cfg{Ldap}{RewriteGroups} = {};
$Foswiki::cfg{Ldap}{RewriteLoginNames} = {};
$Foswiki::cfg{Ldap}{RewriteWikiNames} = {
$Foswiki::cfg{Ldap}{SASLMechanism} = 'PLAIN CRAM-MD5 EXTERNAL ANONYMOUS';
$Foswiki::cfg{Ldap}{SecondaryPasswordManager} = 'Foswiki::Users::HtPasswdUser';
$Foswiki::cfg{Ldap}{TLSCAFile} = '';
$Foswiki::cfg{Ldap}{TLSCAPath} = '';
$Foswiki::cfg{Ldap}{TLSClientCert} = '';
$Foswiki::cfg{Ldap}{TLSClientKey} = '';
$Foswiki::cfg{Ldap}{TLSSSLVersion} = 'tlsv1';
$Foswiki::cfg{Ldap}{TLSVerify} = 'required';
$Foswiki::cfg{Ldap}{Timeout} = 5;
$Foswiki::cfg{Ldap}{UseCanonicalUserIDs} = 0;
$Foswiki::cfg{Ldap}{UseSASL} = 0;
$Foswiki::cfg{Ldap}{UseTLS} = 0;
$Foswiki::cfg{Ldap}{UserBase} = [
'DC=mydomain,DC=com'
];
$Foswiki::cfg{Ldap}{UserMappingTopic} = '';
$Foswiki::cfg{Ldap}{UserScope} = 'sub';
$Foswiki::cfg{Ldap}{Version} = '3';
$Foswiki::cfg{Ldap}{WikiGroupsBackoff} = 1;
$Foswiki::cfg{Ldap}{WikiNameAliases} = '';
$Foswiki::cfg{Ldap}{WikiNameAttributes} = 'givenName,sn';
$Foswiki::cfg{NewUserPlugin}{NewUserTemplate} = 'System.NewLdapUserTemplate';
$Foswiki::cfg{PasswordManager} = 'Foswiki::Users::LdapPasswdUser';
$Foswiki::cfg{UserMappingManager} = 'Foswiki::Users::LdapUserMapping';

-- DavidStievenard - 03 Sep 2018

Try again after removing the working/work_areas/LdapContrib/ directory.

-- MichaelDaum - 05 Sep 2018

did it, same result I can see that the cache is getting infos from my AD

I also tried with the {Ldap}{LoginFilter}: (&(objectClass=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2))) same result

-- DavidStievenard - 05 Sep 2018
 

QuestionForm edit

Subject LDAP
Extension LdapContrib
Version Foswiki 2.1.6
Status Asked
Related Topics
Topic revision: r3 - 05 Sep 2018, DavidStievenard
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy