Hey y’all!
I need help configuring LDAP in my xWiki environment as I really can’t get it to work. This is my current configuration:
xwiki.authentication.authclass=org.xwiki.contrib.ldap.XWikiLDAPAuthServiceImpl
xwiki.authentication.ldap=1
xwiki.authentication.ldap.trylocal=1
xwiki.authentication.ldap.server=bzu-dcs-20.bzu.ads
xwiki.authentication.ldap.bind_DN=CN=sa-ldap,OU=01_ServiceAccInt,OU=01_ServiceAcc,OU=02_SpecialAcc,OU=Users,OU=BZU,DC=bzu,DC=ads
xwiki.authentication.ldap.bind_pass=<password of sa-ldap user>
xwiki.authentication.ldap.base_DN=DC=bzu,DC=ads
xwiki.authentication.ldap.user_group=CN=GRP-BZU-WIKISEK-USERS,OU=Wiki_Groups,OU=Account_Groups,OU=Groups,OU=BZU,DC=bzu,DC=ads
xwiki.authentication.ldap.user_group=CN=GRP-BZU-WIKISEK-ADMINS,OU=Wiki_Groups,OU=Account_Groups,OU=Groups,OU=BZU,DC=bzu,DC=ads
xwiki.authentication.ldap.UID_attr=sAMAccountName
xwiki.authentication.ldap.fields_mapping=last_name=sn,first_name=givenName,email=mail
xwiki.authentication.ldap.update_user=1
xwiki.authentication.ldap.group_mapping=XWiki.BZUGRP-Admins=CN=GRP-BZU-WIKISEK-ADMINS,OU=Wiki_Groups,OU=Account_Groups,OU=Groups,OU=BZU,DC=bzu,DC=ads|\
XWiki.BZUGRP-SekBFSU_User=CN=GRP-BZU-WIKISEK-USERS,OU=Wiki_Groups,OU=Account_Groups,OU=Groups,OU=BZU,DC=bzu,DC=ads
xwiki.authentication.ldap.groupcache_expiration=21600
xwiki.authentication.ldap.mode_group_sync=always
xwiki.authentication.ldap.group_sync_resolve_subgroups=0
The rest is on default settings. I plan to enable SSL after I get LDAP unencrypted to work.
I restarted xwiki after saving my configuration, but it doesn’t work. I enabled debugging in the WEB-INF/classes/logback.xml file, but I can’t find the problem. This is the output of the debug log:
TRACE x.c.l.XWikiLDAPAuthServiceImpl - Starting LDAP authentication
DEBUG o.x.c.l.XWikiLDAPConfig - remoteUserParser: null
DEBUG o.x.c.l.XWikiLDAPConfig - ldap_group_classes: [groupofnames, posixgroup, apple-group, groupofuniquenames, dynamicgroup, groupwisedistributionlist, group, dynamicgroupaux]
DEBUG o.x.c.l.XWikiLDAPConfig - ldap_group_memberfields: [uniquemember, memberuid, member]
DEBUG o.x.c.l.XWikiLDAPConfig - ldap_group_classes: [groupofnames, posixgroup, apple-group, groupofuniquenames, dynamicgroup, groupwisedistributionlist, group, dynamicgroupaux]
DEBUG o.x.c.l.XWikiLDAPConfig - ldap_group_memberfields: [uniquemember, memberuid, member]
DEBUG o.x.c.l.XWikiLDAPConnection - No SRV record for _ldap._tcp.bzu-dcs-20.bzu.ads found.
DEBUG o.x.c.l.XWikiLDAPConnection - No SRV record for _ldap._tcp.bzu-dcs-20.bzu.ads found.
DEBUG o.x.c.l.XWikiLDAPConnection - Connection to LDAP server [bzu-dcs-20.bzu.ads:389]
DEBUG o.x.c.l.XWikiLDAPConnection - Connection to LDAP server [bzu-dcs-20.bzu.ads:389]
DEBUG o.x.c.l.XWikiLDAPConnection - No SRV record for _ldap._tcp.bzu-dcs-20.bzu.ads found.
DEBUG o.x.c.l.XWikiLDAPConnection - Connection to LDAP server [bzu-dcs-20.bzu.ads:389]
DEBUG o.x.c.l.XWikiLDAPConnection - Binding to LDAP server with credentials login=[CN=sa-ldap,OU=01_ServiceAccInt,OU=01_ServiceAcc,OU=02_SpecialAcc,OU=Users,OU=BZU,DC=bzu,DC=ads]
DEBUG o.x.c.l.XWikiLDAPConnection - Binding to LDAP server with credentials login=[CN=sa-ldap,OU=01_ServiceAccInt,OU=01_ServiceAcc,OU=02_SpecialAcc,OU=Users,OU=BZU,DC=bzu,DC=ads]
DEBUG o.x.c.l.XWikiLDAPConnection - Binding to LDAP server with credentials login=[CN=sa-ldap,OU=01_ServiceAccInt,OU=01_ServiceAcc,OU=02_SpecialAcc,OU=Users,OU=BZU,DC=bzu,DC=ads]
DEBUG x.c.l.XWikiLDAPAuthServiceImpl - Checking if the user belongs to the user group: CN=GRP-BZU-WIKISEK-ADMINS,OU=Wiki_Groups,OU=Account_Groups,OU=Groups,OU=BZU,DC=bzu,DC=ads
DEBUG o.x.c.l.XWikiLDAPUtils - Retrieving Members of the group [CN=GRP-BZU-WIKISEK-ADMINS,OU=Wiki_Groups,OU=Account_Groups,OU=Groups,OU=BZU,DC=bzu,DC=ads]
2024
DEBUG x.c.l.XWikiLDAPAuthServiceImpl - Checking if the user belongs to the user group: CN=GRP-BZU-WIKISEK-ADMINS,OU=Wiki_Groups,OU=Account_Groups,OU=Groups,OU=BZU,DC=bzu,DC=ads
DEBUG o.x.c.l.XWikiLDAPUtils - [CN=GRP-BZU-WIKISEK-ADMINS,OU=Wiki_Groups,OU=Account_Groups,OU=Groups,OU=BZU,DC=bzu,DC=ads] is a valid DN, lets try to get corresponding entry.
DEBUG x.c.l.XWikiLDAPAuthServiceImpl - Checking if the user belongs to the user group: CN=GRP-BZU-WIKISEK-ADMINS,OU=Wiki_Groups,OU=Account_Groups,OU=Groups,OU=BZU,DC=bzu,DC=ads
DEBUG o.x.c.l.PagedLDAPSearchResults - LDAP pagined search: base=[CN=GRP-BZU-WIKISEK-ADMINS,OU=Wiki_Groups,OU=Account_Groups,OU=Groups,OU=BZU,DC=bzu,DC=ads] query=[null] attrs=[[objectClass, uniquemember, memberuid, member, sAMAccountName]] scope=[2] typesOnly=[false] pageSize=[500], cookie=[null]
DEBUG o.x.c.l.XWikiLDAPUtils - [CN=GRP-BZU-WIKISEK-ADMINS,OU=Wiki_Groups,OU=Account_Groups,OU=Groups,OU=BZU,DC=bzu,DC=ads] is a group
DEBUG o.x.c.l.XWikiLDAPUtils - |- Member value [CN=<our employee>,OU=03_IT,OU=01_NormalAcc,OU=Users,OU=BZU,DC=bzu,DC=ads] found. Trying to resolve it.
DEBUG o.x.c.l.XWikiLDAPUtils - [CN=<account from us>,OU=03_IT,OU=01_NormalAcc,OU=Users,OU=BZU,DC=bzu,DC=ads] is a valid DN, lets try to get corresponding entry.
DEBUG o.x.c.l.XWikiLDAPUtils - Group members resolve is disabled to add [CN=<account from us>,OU=03_IT,OU=01_NormalAcc,OU=Users,OU=BZU,DC=bzu,DC=ads] as group member directly
This happens to every user of the group GRP-BZU-WIKISEK-ADMINS, not going to post every debug of every user here, all the same.
It then continues with this:
DEBUG o.x.c.l.XWikiLDAPUtils - Found cache entry for group [CN=GRP-BZU-WIKISEK-ADMINS,OU=Wiki_Groups,OU=Account_Groups,OU=Groups,OU=BZU,DC=bzu,DC=ads]
2024
DEBUG o.x.c.l.XWikiLDAPUtils - Found group [CN=GRP-BZU-WIKISEK-ADMINS,OU=Wiki_Groups,OU=Account_Groups,OU=Groups,OU=BZU,DC=bzu,DC=ads] members [{<cns of all members>}]
DEBUG o.x.c.l.XWikiLDAPUtils - Found user dn in user group [null]
DEBUG x.c.l.XWikiLDAPAuthServiceImpl - Local LDAP authentication failed.
com.xpn.xwiki.XWikiException: Error number 8001 in 8: LDAP user adminits does not belong to LDAP group CN=GRP-BZU-WIKISEK-ADMINS,OU=Wiki_Groups,OU=Account_Groups,OU=Groups,OU=BZU,DC=bzu,DC=ads.
at org.xwiki.contrib.ldap.XWikiLDAPAuthServiceImpl.ldapAuthenticateInContext(XWikiLDAPAuthServiceImpl.java:603)
at org.xwiki.contrib.ldap.XWikiLDAPAuthServiceImpl.ldapAuthenticate(XWikiLDAPAuthServiceImpl.java:373)
at org.xwiki.contrib.ldap.XWikiLDAPAuthServiceImpl.authenticate(XWikiLDAPAuthServiceImpl.java:307)
...
...
... and more stuff
The only thing I seem is a bit odd is No SRV record for _ldap._tcp.bzu-dcs-20.bzu.ads found, but that’s our LDAP server. I also did a traceroute from my windows machine and got the following:
_ldap._tcp.dc._msdcs.bzu.ads SRV service location:
priority = 0
weight = 100
port = 389
svr hostname = bzu-dcs-20.bzu.ads
so LDAP is indeed available.
Anyone here seeing what I’m missing?