Magnolia CMS to Active Directory Connection via LDAP
#1 by pmayank1391 on Nov 9, 2016 12:54:55 PM

Hello Community,

I am using Magnolia enterprise edition-5.4.9.
I am new to magnolia and trying to login to magnolia with a user present in my local Active directory (ApacheDS).
I followed all the steps as per the LDAP module documentation present at
"https://documentation.magnolia-cms.com/display/DOCS/LDAP+Connector+module" location and also verified the active directory connection with magnolia-ldap-tester jar and it's working fine, but
when I tried to login with the same user credentials in magnolia, I am getting the following error:
---------------------------------------------------------------------------------------------------------
ERROR info.magnolia.jaas.sp.ldap.LDAPUserManager 09.11.2016 11:42:05 -- Failed to resolve roles assigned
java.lang.NullPointerException
at info.magnolia.jaas.sp.ldap.resolver.MagnoliaRoleResolver.getNames(MagnoliaRoleResolver.java:40)
at info.magnolia.jaas.sp.ldap.LDAPUserManager.populateRoleListByRoleResolver(LDAPUserManager.java:271)
at info.magnolia.jaas.sp.ldap.LDAPUserManager.getUser(LDAPUserManager.java:203)
at info.magnolia.jaas.sp.ldap.LDAPUserManager.getUser(LDAPUserManager.java:89)
at info.magnolia.cms.security.DelegatingUserManager$5.delegate(DelegatingUserManager.java:112)
at info.magnolia.cms.security.DelegatingUserManager$5.delegate(DelegatingUserManager.java:109)
at info.magnolia.cms.security.DelegatingUserManager.delegateUntilSupportedAndNotNull(DelegatingUserManager.java:186)
at info.magnolia.cms.security.DelegatingUserManager.getUser(DelegatingUserManager.java:109)
at info.magnolia.jaas.sp.jcr.JCRAuthenticationModule.initUser(JCRAuthenticationModule.java:136)
at info.magnolia.jaas.sp.jcr.JCRAuthenticationModule.validateUser(JCRAuthenticationModule.java:108)
at info.magnolia.jaas.sp.AbstractLoginModule.login(AbstractLoginModule.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:762)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:203)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:690)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:687)
at javax.security.auth.login.LoginContext.login(LoginContext.java:595)
at info.magnolia.cms.security.SecuritySupportBase.authenticate(SecuritySupportBase.java:61)
at info.magnolia.cms.security.SecuritySupport$$EnhancerByCGLIB$$b1ff0569.authenticate(<generated>)
at info.magnolia.cms.security.auth.login.LoginHandlerBase.authenticate(LoginHandlerBase.java:46)
at info.magnolia.cms.security.auth.login.FormLogin.handle(FormLogin.java:85)
at info.magnolia.cms.security.auth.login.LoginFilter.doFilter(LoginFilter.java:71)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)
at info.magnolia.enterprise.registration.RegistrationFilter.doFilter(RegistrationFilter.java:64)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81)
at info.magnolia.cms.filters.CosMultipartRequestFilter.doFilter(CosMultipartRequestFilter.java:87)
at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:59)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)
at info.magnolia.personalization.preview.filter.PreviewFilter.doFilter(PreviewFilter.java:92)
at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:59)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)
at info.magnolia.personalization.trait.AbstractTraitDetectorFilter.doFilter(AbstractTraitDetectorFilter.java:74)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)
at info.magnolia.personalization.trait.AbstractTraitDetectorFilter.doFilter(AbstractTraitDetectorFilter.java:74)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)
at info.magnolia.personalization.trait.AbstractTraitDetectorFilter.doFilter(AbstractTraitDetectorFilter.java:74)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)
at info.magnolia.personalization.trait.AbstractTraitDetectorFilter.doFilter(AbstractTraitDetectorFilter.java:74)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)
at info.magnolia.cms.filters.ContentTypeFilter.doFilter(ContentTypeFilter.java:155)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)
at info.magnolia.cms.filters.ContextFilter.doFilter(ContextFilter.java:128)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79)
at info.magnolia.cms.filters.CompositeFilter.doFilter(CompositeFilter.java:65)
at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85)
at info.magnolia.cms.filters.SafeDestroyMgnlFilterWrapper.doFilter(SafeDestroyMgnlFilterWrapper.java:107)
at info.magnolia.cms.filters.MgnlFilterDispatcher.doDispatch(MgnlFilterDispatcher.java:67)
at info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:108)
at info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:94)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
---------------------------------------------------------------------------------------------------------

MY ou name in AD and group name in magnolia are also same as mentioned in the documentation.

Please help