Good day,
I am using Tomcat and WAFFLE (https://github.com/Waffle/waffle) to perform SSO and the LDAP Authenticator extension (https://extensions.xwiki.org/xwiki/bin/view/Extension/LDAP/Authenticator/) with settings:
xwiki.authentication.authclass=org.xwiki.contrib.ldap.XWikiLDAPAuthServiceImpl
xwiki.authentication.ldap=1
I’ve enabled logging in LDAP, so I know that the LDAP extension sees the remote username in the log:
2018-09-21 08:20:35,713 [https://tomcatserverfqdn/xwiki/bin/view/Main/] DEBUG x.c.l.XWikiLDAPAuthServiceImpl - RemoteUser: domainname\username
Since remote user format is domainname\username, I am trying to use remote user mapping settings:
xwiki.authentication.ldap.remoteUserParser=(.+)\\\\(.+)
xwiki.authentication.ldap.remoteUserMapping.1=domain,ldap_server,ldap_port,ldap_base_DN,ldap_bind_DN,ldap_bind_pass
xwiki.authentication.ldap.remoteUserMapping.2=uid
xwiki.authentication.ldap.remoteUserMapping.ldap_server=domainname=ldapserverfqdn
xwiki.authentication.ldap.remoteUserMapping.ldap_port=domainname=389
xwiki.authentication.ldap.remoteUserMapping.ldap_base_DN=domainname=DC=domainname,DC=suffix
xwiki.authentication.ldap.remoteUserMapping.ldap_bind_DN=domainname=uid
xwiki.authentication.ldap.remoteUserMapping.ldap_bind_pass=domainname=password
However when I attempt to use this configuration, this is what I see in the logs:
2018-09-21 10:05:03,746 [https://tomcatserverfqdn/xwiki/bin/view/Main/] DEBUG x.c.l.XWikiLDAPAuthServiceImpl - RemoteUser: domainname\username
2018-09-21 10:05:03,748 [https://tomcatserverfqdn/xwiki/bin/view/Main/] DEBUG o.x.c.l.XWikiLDAPConfig - remoteUserParser: (.+)\\(.+)
2018-09-21 10:05:03,749 [https://tomcatserverfqdn/xwiki/bin/view/Main/] DEBUG o.x.c.l.XWikiLDAPConfig - hostConvertor: {}
2018-09-21 10:05:03,749 [https://tomcatserverfqdn/xwiki/bin/view/Main/] DEBUG o.x.c.l.XWikiLDAPConfig - hostConvertor: {}
2018-09-21 10:05:03,749 [https://tomcatserverfqdn/xwiki/bin/view/Main/] DEBUG o.x.c.l.XWikiLDAPConfig - hostConvertor: {}
2018-09-21 10:05:03,749 [https://tomcatserverfqdn/xwiki/bin/view/Main/] DEBUG o.x.c.l.XWikiLDAPConfig - hostConvertor: {}
2018-09-21 10:05:03,750 [https://tomcatserverfqdn/xwiki/bin/view/Main/] DEBUG o.x.c.l.XWikiLDAPConfig - hostConvertor: {}
2018-09-21 10:05:03,750 [https://tomcatserverfqdn/xwiki/bin/view/Main/] DEBUG o.x.c.l.XWikiLDAPConfig - hostConvertor: {}
2018-09-21 10:05:03,750 [https://tomcatserverfqdn/xwiki/bin/view/Main/] DEBUG o.x.c.l.XWikiLDAPConfig - hostConvertor: {}
2018-09-21 10:05:03,766 [https://tomcatserverfqdn/xwiki/bin/view/Main/] DEBUG o.x.c.l.XWikiLDAPConfig - ldap_group_classes: [groupofnames, posixgroup, apple-group, groupofuniquenames, dynamicgroup, groupwisedistributionlist, group, dynamicgroupaux]
2018-09-21 10:05:03,766 [https://tomcatserverfqdn/xwiki/bin/view/Main/] DEBUG o.x.c.l.XWikiLDAPConfig - ldap_group_memberfields: [uniquemember, memberuid, member]
2018-09-21 10:05:03,851 [https://tomcatserverfqdn/xwiki/bin/view/Main/] DEBUG o.x.c.l.XWikiLDAPConnection - Connection to LDAP server [domainname:389]
2018-09-21 10:05:03,864 [https://tomcatserverfqdn/xwiki/bin/view/Main/] DEBUG o.x.c.l.XWikiLDAPConnection - Binding to LDAP server with credentials login=[domainname]
2018-09-21 10:05:03,952 [https://tomcatserverfqdn/xwiki/bin/view/Main/] DEBUG x.c.l.XWikiLDAPAuthServiceImpl - Local LDAP authentication failed.
org.xwiki.contrib.ldap.XWikiLDAPException: Error number 0 in 5: LDAP bind failed with LDAPException.
Why is connection to LDAP server trying [domainname:389] instead of [ldapserverfqdn:389]?
Why is bind to LDAP server with credentials login=[domainname] instead of login=[username]?
Am I not understanding how to use the remoteUserMapping settings?