This question about LDAP: Closed unanswered
No login with LDAP, no debug messages either
Hi,
i am trying to setup login via LDAP, but it does not work. I switched on debug-mode, but not debug is written to the debug-file debug.txt, but file and directoy permissions for the data-directory are set to be writeable by the webserver-user. Finally i tried to sniff my network to analyze the ldap-messages, but unfortunately foswiki seems not to even contact my ldap-server. I have attached my
LocalSite.cfg.
Apache error-log says:
[Tue May 25 11:56:54 2010] [error] [client 22.26.66.132] -
LdapContrib - cacheAge=9999999999, maxCacheAge=86400, lastUpdate=0, refresh=1, referer:
https://koenigstuhl.subd.uni-somecity.de/foswiki/bin/login/Main/WebHome?origurl=/foswiki/bin/view/[Tue May 25 11:56:54 2010] [error] [client 22.26.66.132] -
LdapContrib - updating cache, referer:
https://koenigstuhl.subd.uni-somecity.de/foswiki/bin/login/Main/WebHome?origurl=/foswiki/bin/view/[Tue May 25 11:56:54 2010] [error] [client 22.26.66.132] -
LdapContrib - WARNING: already refreshing cache, referer:
https://koenigstuhl.subd.uni-somecity.de/foswiki/bin/login/Main/WebHome?origurl=/foswiki/bin/view/[Tue May 25 11:56:54 2010] [error] [client 22.26.66.132] -
LdapContrib - updating cache done, referer:
https://koenigstuhl.subd.uni-somecity.de/foswiki/bin/login/Main/WebHome?origurl=/foswiki/bin/view/
Thank you for your help,
--
PeterSchmidt - 29 May 2010
As you mentioned, there is a configure setting
{Ldap}{Debug}
which enables logging to
debug.txt
. However, per default, most debugging messages are turned off in the source. To enabled them you have to edit
lib/Foswiki/Contrib/LdapContrib.pm
(remove the comment character # in front of
writeDebug
messages you're interested in).
You can also check if the cached database contains anything useful. The cache is stored in
working/work_areas/LdapContrib/cache.db
, however, it's a Berkeley DB file, not plain text (use
db_dump -p
to get the content out).
If you give us more information about your setup and config, we might point you in the right direction.
--
MartinKaufmann - 29 May 2010
I have uncommented all writeDebug.calls in
LdapContrib.pm ... no change unfortunately.
The contents of cache.db:
VERSION=3
format=print
type=hash
db_pagesize=4096
HEADER=END
DATA=END
What else information do you need?
--
PeterSchmidt - 29 May 2010
How is
LdapContrib configured? Check
Question471 for an example. It is important that the PasswordManager and UserMappingManager are set to use
LdapContrib.
--
MartinKaufmann - 29 May 2010
$Foswiki::cfg{UserMappingManager} = 'Foswiki::Users::LdapUserMapping';
$Foswiki::cfg{PasswordManager} = 'none';
Can it be the
PasswordManager thats causing my fault? I always thought, the passwordManagaer is used for updating passwords, not for rerieving credentials. My complete configuration is attached at the bottom.
--
PeterSchmidt - 29 May 2010
Yes, you definitely have to set
PasswordManager
to something useful. See
LdapContrib#Authentication. Let us know if that solves your issue.
--
MartinKaufmann - 29 May 2010
Modified
PasswordManager to:
$Foswiki::cfg{PasswordManager} = 'Foswiki::Users::LdapPasswdUser';
Unfortunately this did not solve the problem. Can you give me another hint? I have all perl libraries marked as 'required' installed. Do i have to install some 'optional' libraries too?I think it is very suspicious, that there is not debug-file created at all.
--
PeterSchmidt - 30 May 2010
The required CPAN libraries should suffice. What happens when you try to log in? Do you get any error messages? The only thing I noticed in your configuration is the empty BIND user. Does your LDAP server allow anonymouse bind?
I don't understand how you don't get any debug messages if you uncommented all debug statements in the source. I've ran out of ideas.
You might want to head over to
Foswiki's IRC channel to get support from the developers directly.
--
MartinKaufmann - 30 May 2010
Reinstalled foswiki from scratch. Ldap now works perfectly. The debug-file-problem still exists, but i dont care
Thank you!
--
PeterSchmidt - 01 Jun 2010
I got the same problem today, it seems that lock file (/var/lib/foswiki/working/work_areas/LdapContrib/cache.db_tmp) from previous cache update process wasn't removed. That's why there was log message "WARNING: already refreshing". Deleting the file solved the problem.
--
KrzysztofGoBiowski - 29 Mar 2011