Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-65498

'Unable to encrypt blank password' error on scheduled import from LDAP

    Details

      Description

      SUMMARY
      The LDAP import doesn't work and there is an 'Unable to encrypt blank password' error in the log. It seems to be a regression of LPS-62030.

      REPRODUCTION STEPS

      • Prepare an LDAP server (reproduced with OpenLDAP, but couldn't reproduce with ApacheDS).
      • Connect Liferay portal with an LDAP server with at least 1 user in LDAP!
        • 7.0/Master:
          • Go to Control Panel - Instance Settings - Authentication - Configuration tab - LDAP tab
          • Add an LDAP Server using one of the available defaults, e.g. Apache DS
          • Check "Enabled" and "Import Enabled"
          • Go to Control Panel - System Settings - Foundation - LDAP Import
          • Check "Import Enabled" ("User Password" is checked by default, it's fine)
          • [You can also modify the interval for the import so you don't need to wait ~10sec)
          • Save
        • 6.2:
          • Configure LDAP through Control Panel - Portal Settings - Authentication
      • Restart the portal and wait until the users are imported (check the DB or go to the Users and Organizations)
      • Stop the portal
      • Go to your LDAP server and edit the LDAP user: change for example its "givenName" for something else
      • Start the portal
        Expected result: No errors, import works
        Actual result: This error appears in the log during scheduled import, import doesn't work:
        14:47:47,728 ERROR [liferay/scheduled_user_ldap_import-1][LDAPUserImporterImpl:796] Unable to import user cn=user1: null:null:{cn=cn: user1}
        com.liferay.portal.kernel.exception.PwdEncryptorException: Unable to encrypt blank password
                at com.liferay.portal.security.pwd.BasePasswordEncryptor.encrypt(BasePasswordEncryptor.java:46)
                at com.liferay.portal.security.pwd.BasePasswordEncryptor.encrypt(BasePasswordEncryptor.java:34)
                at com.liferay.portal.kernel.security.pwd.PasswordEncryptorUtil.encrypt(PasswordEncryptorUtil.java:74)
                at com.liferay.portal.kernel.security.pwd.PasswordEncryptorUtil.encrypt(PasswordEncryptorUtil.java:60)
                at com.liferay.portal.service.impl.UserLocalServiceImpl.updatePassword(UserLocalServiceImpl.java:4728)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:497)
                at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:153)
                at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:85)
                at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
                at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
                at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
                at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
                at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:173)
                at com.sun.proxy.$Proxy80.updatePassword(Unknown Source)
                at com.liferay.portal.security.ldap.internal.exportimport.LDAPUserImporterImpl.updateUserPassword(LDAPUserImporterImpl.java:1567)
                at com.liferay.portal.security.ldap.internal.exportimport.LDAPUserImporterImpl.updateUser(LDAPUserImporterImpl.java:1443)
                at com.liferay.portal.security.ldap.internal.exportimport.LDAPUserImporterImpl.importUser(LDAPUserImporterImpl.java:1032)
                at com.liferay.portal.security.ldap.internal.exportimport.LDAPUserImporterImpl.importFromLDAPByUser(LDAPUserImporterImpl.java:785)
                at com.liferay.portal.security.ldap.internal.exportimport.LDAPUserImporterImpl.importUsers(LDAPUserImporterImpl.java:456)
                at com.liferay.portal.security.ldap.internal.exportimport.LDAPUserImporterImpl.importUsers(LDAPUserImporterImpl.java:395)
                at com.liferay.portal.security.ldap.internal.messaging.UserImportMessageListener.doReceive(UserImportMessageListener.java:84)
                at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
                at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper.receive(SchedulerEventMessageListenerWrapper.java:65)
                at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
                at com.liferay.portal.kernel.messaging.SerialDestination$1.run(SerialDestination.java:58)
                at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:756)
                at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:667)
                at java.lang.Thread.run(Thread.java:745)
        

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                4 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  2 years, 47 weeks, 3 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 DXP FP8
                  7.0.0 DXP SP2
                  7.0.3 CE GA4
                  Master