Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDAP integration #240

Open
c0rp-aubakirov opened this issue Sep 5, 2015 · 1 comment
Open

LDAP integration #240

c0rp-aubakirov opened this issue Sep 5, 2015 · 1 comment

Comments

@c0rp-aubakirov
Copy link

If I add LdapAuthenticationProvider, after login i see this error:

org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [lightadmin-dispatcher-redirector] in context with path [] threw exception [Request processing failed; nested exception is org.apache.tiles.request.render.CannotRenderException: ServletException including path '/views/layout/external-layout.jsp'.] with root cause
java.lang.NullPointerException
at     org.apache.tiles.template.DefaultAttributeResolver.computeAttribute(DefaultAttributeResolver.java:43)
at org.apache.tiles.template.InsertAttributeModel.resolveAttribute(InsertAttributeModel.java:165)

Could you please point me what to do? I Could provide code that I add if needed

Here is xml

<bean id="contextSource"
      class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
    <constructor-arg value="${ldap_url}"/>
    <property name="userDn" value="${user_dn}"/>
    <property name="password" value="${user_pass}"/>
</bean>

<bean id="ldapAuthProvider" lazy-init="true"
      class="org.springframework.security.ldap.authentication.LdapAuthenticationProvider">
    <constructor-arg>
        <bean class="org.springframework.security.ldap.authentication.BindAuthenticator">
            <constructor-arg ref="contextSource"/>
            <!--<property name="userDnPatterns">-->
                <!--<list><value>${user_patterns}</value></list>-->
            <!--</property>-->
            <property name="userSearch" ref="userSearch"/>
        </bean>
    </constructor-arg>
    <constructor-arg>
        <bean
                class="org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator">
            <constructor-arg ref="contextSource"/>
            <constructor-arg value="${base_dn}"/>
            <property name="searchSubtree" value="true"/>
            <property name="groupRoleAttribute" value="${group_role_attr}"/>
            <property name="groupSearchFilter" value="${search_filter}"/>
        </bean>
    </constructor-arg>
</bean>

<bean id="userSearch" class="org.springframework.security.ldap.search.FilterBasedLdapUserSearch">
    <constructor-arg index="0" value="${base_dn}" />
    <constructor-arg index="1" value="${search_filter}" />
    <constructor-arg index="2" ref="contextSource" />
    <property name="searchSubtree" value="true" />
</bean>

I know that LDAP config works, because I see success messages in LDAP log files, but in lightadmin web interface logs error messages "java.io.IOException: ServletException including path '/views/layout/external-layout.jsp'".

While keeping this LDAP beans and configs, I still can normally login as admin/admin.

@c0rp-aubakirov
Copy link
Author

I found out that this is because of there is no needed role in my LDAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant