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

As developer, I would create my own LDAPUserImporter

    Details

      Description

      The hot-deploy of an custom LDAPUserImporter service implementation is ignored, the scheduler (com.liferay.portal.security.ldap.internal.messaging.UserImportMessageListener) and the LDAP authenticator (com.liferay.portal.security.ldap.internal.authenticator.LDAPAuth) continues to use the default implementation (com.liferay.portal.security.ldap.internal.exportimport.LDAPUserImporterImpl).

      This is due to "policyOption" attribute's value of @Reference annotation into UserImportMessageListener and LDAPAuth. It should be set to policyOption=ReferencePolicyOption.GREEDY:

      	@Reference(policyOption=ReferencePolicyOption.GREEDY, unbind = "-")
      	protected void setLdapUserImporter(LDAPUserImporter ldapUserImporter) {
      		_ldapUserImporter = ldapUserImporter;
      	}
      

      The steps to replicate the issue are:

      1. Enable LDAP Import
      2. Create an bundle with a custom component that implements LDAPUserImporter service with high service ranking
        @Component(
        	immediate = true,
        	property = {
        		Constants.SERVICE_RANKING + "=500"
        	},
        	service = { LDAPUserImporter.class, UserImporter.class }
        )
        public class CustomLDAPUserImporter implements LDAPUserImporter, UserImporter {
        
      3. deploy the new bundle

      Expected: the next LDAP import will use my custom implementation
      Result: the system continue to use the portal LDAP importer

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  2 years, 27 weeks, 6 days ago

                  Packages

                  Version Package
                  7.0.0 DXP FP11
                  7.0.0 DXP SP2
                  7.0.3 CE GA4
                  Master