I don’t have a particular error to debug, so I keep the Basics short:
The Basics
- Nextcloud Server version (e.g., 29.x.x):
32.xin Docker-Container
- Operating system and version (e.g., Ubuntu 24.04):
Debian 13
- Proxy:
HAproxy on pfSense-Plus
Situation
We/I run a nc-docker-compose stack on a debian server for years now.
We use the user_external addon and authenticate users against a dovecot IMAP server.
All this works fine, although lately I notice that the support for that addon seems to fade a bit: the compatibility with NC-32 is discussed somehow etc . So I start looking for alternatives.
As we also run a samba-based AD domain it is very obvious to use the AD as authentication backend.
So I start checking out the “LDAP user and group backend” addon.
I have it connected already and am on my way configuring it.
Question
So far the nc-accounts coming from the IMAP-backend are named like the userpart of the email-adresses:
So there is an account like john.smith in NC created for the email-adress john-smith@my.tld
If we migrate this to the LDAP-backend we would definitely want to keep the NC-accounts with their “content”.
So I need to make sure that LDAP-users map to their former account-names, right?
So far I managed to log in via LDAP by using the whole mail-attribute.
And I wonder what would be the easiest and least invasive way to get this matching right.
Would it make sense to rename all the accounts in the NC-database maybe?
postgres-DB-backend nc: from john.smith to john-smith@my.tld
and then the LDAP-login uses mail and things fit?
Or is there a clever way to create an LDAP-filter to use with the NC-addon to somehow add the domain-part to the login string when sending the query to LDAP?
Right now it’s:
(&(&(|(objectclass=person)))(|(samaccountname=%uid)(|(mailPrimaryAddress=%uid)(mail=%uid))(|(mail=%uid)(sAMAccountName=%uid))))
Maybe I could simply edit this to something like
(mailPrimaryAddress=%uid)@my.tld or so?
Yes, I can test this myself and will do
(I have a complete clone of that stack for tests)
I’d just like to brainstorm and ask if anyone has done this and avoid mistakes as much as I can.
thanks, looking forward to any feedback
Stefan