Account created on 23 July 2024, 2 months ago
#

Recent comments

I tried to find a temporary fix for the specific problem that there is no authmap entry and the ldap entry is not associated with the user profile when self registration via drupal is used.
I hope OpenLDAP support will be systematically for this module and there will be a solution provided by one of the next minor updates.

diff --git a/LdapEntryProvisionSubscriber.php b/LdapEntryProvisionSubscriber_patched.php
index e69e6bf..7cdc2de 100644
--- a/LdapEntryProvisionSubscriber.php
+++ b/LdapEntryProvisionSubscriber_patched.php
@@ -545,6 +545,21 @@ class LdapEntryProvisionSubscriber implements EventSubscriberInterface, LdapUser
       $callback_params = [$entry, $this->ldapServer, $context];
       $this->moduleHandler->invokeAll('ldap_entry_post_provision', $callback_params);
       $this->updateUserProvisioningReferences($entry);
+
+      /* tmp fix issue 3247641 begin */
+       $userProcessor = \Drupal::service('ldap.drupal_user_processor');
+       $userName = $this->account ? $this->account->getAccountName() : Null;
+       if(!empty($userName)) {
+               $association = $userProcessor->ldapAssociateDrupalAccount($userName);
+
+               if (!$association) {
+                       \Drupal::messenger()->addWarning(t('Account created but no LDAP account found to associate with.'));
+               }
+       }else {
+               \Drupal::messenger()->addWarning(t('Account name missing. Association with LDAP account failed.'));
+       }
+
+       /* tmp fix issue 3247641 end */
     }
     else {
       $this->logger->error('LDAP entry for @username cannot be created on @sid. Proposed DN: %dn)',

Thank you for your investigation and documentation! This issue is still a problem for me using version 8.x-4.11 with openLDAP.

Only if registration by admin is selected here ldap accounts can be associated with drupal accounts by creating them manually with the checkbox "Create corresponding LDAP entry".
/admin/config/people/accounts

I want to enable self registration and use openLDAP. But with this issue it is not possible because user entries in LDAP will not get updated.

Without an authmap entry / the user profile ldap fields the module always tries to create new ldap entry when an profile update is triggered. The module throws an error and does not associate the existing ldap entry with the drupal user account.

Error:
LDAP server ldap_xy exception: Could not add entry "uid=xy,ou=People,dc=xy,dc=xy": Already exists

It would be awesome if anybody could find a solution for this problem.

Production build 0.71.5 2024