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

LDap authentication fails if user's group is removed

    Details

      Description

      1. Enable ldap authentication, ldap user and group import
      2. login using ldap auth
      3. remove group that gets imported with user
      4. try login again

      on step 4 login fails as the user group is not imported again because ldap import group cache is not invalidated properly when group is removed.

      The relevant part of the stacktrace is following:
      [code]
      09:54:50,192 INFO [stdout] (ajp--0.0.0.0-8009-9) 09:54:50,188 ERROR [ajp--0.0.0.0-8009-9][LDAPAuth:327] Problem accessing LDAP server
      09:54:50,193 INFO [stdout] (ajp--0.0.0.0-8009-9) com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.ModelListenerException: com.liferay.portal.NoSuchUserGroupException: No UserGroup exists with the primary key 438703
      09:54:50,194 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:193)
      09:54:50,195 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.service.persistence.UserGroupPersistenceImpl.addUsers(UserGroupPersistenceImpl.java:3894)
      09:54:50,196 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.service.impl.UserLocalServiceImpl.addUserGroupUsers(UserLocalServiceImpl.java:569)
      09:54:50,197 INFO [stdout] (ajp--0.0.0.0-8009-9) at sun.reflect.GeneratedMethodAccessor1317.invoke(Unknown Source)
      09:54:50,197 INFO [stdout] (ajp--0.0.0.0-8009-9) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:54:50,198 INFO [stdout] (ajp--0.0.0.0-8009-9) at java.lang.reflect.Method.invoke(Method.java:597)
      09:54:50,199 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122)
      09:54:50,200 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
      09:54:50,201 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
      09:54:50,201 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
      09:54:50,202 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
      09:54:50,203 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
      09:54:50,204 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
      09:54:50,205 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
      09:54:50,205 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
      09:54:50,206 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
      09:54:50,207 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
      09:54:50,208 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
      09:54:50,209 INFO [stdout] (ajp--0.0.0.0-8009-9) at $Proxy136.addUserGroupUsers(Unknown Source)
      09:54:50,209 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.service.UserLocalServiceUtil.addUserGroupUsers(UserLocalServiceUtil.java:483)
      09:54:50,210 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importGroups(PortalLDAPImporterImpl.java:858)
      09:54:50,211 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importLDAPUser(PortalLDAPImporterImpl.java:235)
      09:54:50,212 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.security.ldap.PortalLDAPImporterUtil.importLDAPUser(PortalLDAPImporterUtil.java:57)
      09:54:50,213 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.security.auth.LDAPAuth.authenticate(LDAPAuth.java:300)
      09:54:50,213 INFO [stdout] (ajp--0.0.0.0-8009-9) at com.liferay.portal.security.auth.LDAPAuth.authenticate(LDAPAuth.java:384)

      [/code]

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

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

                Packages

                Version Package