nextcloud / ldap_contacts_backend

🗃️ LDAP backend for Nextcloud Contacts
https://apps.nextcloud.com/apps/ldap_contacts_backend
GNU Affero General Public License v3.0
9 stars 7 forks source link

Copy to address book not working - configuration issue? #146

Open klasyc opened 4 months ago

klasyc commented 4 months ago

Hello,

I am trying to configure this plugin with my Nextcloud 28 instance. The authentication is handled by Keycloak via OpenID Connect Login plugin. Keycloak federates the user database from my Active Directory server, and the LDAP user backend plugin should be connected directly to my Active Directory server, bypassing Keycloak.

I installed the plugin and configured it as follows (the LDAP server is running locally):

id: 0
addressBookDisplayName: mycompany
host: localhost
port: 389
agentDn: CN=CloudContacts,OU=MyCompany-Services,DC=int,DC=example,DC=com
agentPassword: mySecretPass
bases:
  OU=MyCompany-Users,DC=int,DC=example,DC=com
searchAttributes:
  cn
  mail
  telephoneNumber
attributeMapping:
  EMAIL: mail
  FN: cn
  TEL: telephoneNumber
tEnc: none
filter:

Now, I can see my LDAP users in the contacts' menu in the top right corner of my Nextcloud user interface. Unfortunately, when I click the "Copy to address book" option, I get the Internal server error page and in the Nextcloud log system, I can see the following error:

LdapException Could not complete search with dn "CN=My Person,OU=test,OU=MyCompany-Users,DC=int,DC=example,DC=com",
query "" and filters "*". LDAP error was [-1] Can't contact LDAP server.

1. /var/www/html/nextcloud/apps/ldap_contacts_backend/lib/Service/LdapQuerent.php line 55
   Symfony\Component\Ldap\Adapter\ExtLdap\Query->execute()
2. /var/www/html/nextcloud/apps/ldap_contacts_backend/lib/Service/LdapCardBackend.php line 55
   OCA\LDAPContactsBackend\Service\LdapQuerent->fetchOne()
3. /var/www/html/nextcloud/apps/ldap_contacts_backend/lib/Service/AddressBook.php line 58
   OCA\LDAPContactsBackend\Service\LdapCardBackend->getCard() 
4. /var/www/html/nextcloud/apps/ldap_contacts_backend/lib/Controller/ContactsController.php line 83
   OCA\LDAPContactsBackend\Service\AddressBook->getChild()
5. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 230
   OCA\LDAPContactsBackend\Controller\ContactsController->import()
6. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 137
   OC\AppFramework\Http\Dispatcher->executeController()
7. /var/www/html/nextcloud/lib/private/AppFramework/App.php line 184
   OC\AppFramework\Http\Dispatcher->dispatch()
8. /var/www/html/nextcloud/lib/private/Route/Router.php line 315
   OC\AppFramework\App::main()
9. /var/www/html/nextcloud/lib/base.php line 1069
   OC\Route\Router->match()
10. /var/www/html/nextcloud/index.php line 39
   OC::handleRequest()

Please guys, could you help me to fix this issue?

blizzz commented 4 months ago

@klasyc thanks for opening with those details! Do you have the full backtrace of the LdapException, not only the first three items?

klasyc commented 4 months ago

Sure, I've updated my initial post.