Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well I made a test Spring App in order to do authentication of users.. I am not sure if this is what you want, but I will post the solution anyway. (this post is a little bit late.. but)</p> <p>Like I said I used spring, spring security and apacheDS. </p> <p>spring-security.xml</p> <pre><code> &lt;!-- This is where we configure Spring-Security --&gt; &lt;security:http auto-config="true" use-expressions="true" access-denied-page="/app/denied" &gt; &lt;security:intercept-url pattern="/app/login" access="permitAll"/&gt; &lt;security:intercept-url pattern="/app/admin" access="hasRole('ROLE_ADMIN')"/&gt; &lt;security:intercept-url pattern="/app/common" access="hasRole('ROLE_USER')"/&gt; &lt;security:form-login login-page="/app/login" authentication-failure-url="/app/login?error=true" default-target-url="/app/common"/&gt; &lt;security:logout invalidate-session="true" logout-success-url="/app/login" logout-url="/app/logout"/&gt; &lt;/security:http&gt; &lt;security:authentication-manager&gt; &lt;security:ldap-authentication-provider user-search-filter="(uid={0})" user-search-base="ou=users" group-search-filter="(uniqueMember={0})" group-search-base="ou=groups" group-role-attribute="cn" role-prefix="ROLE_"&gt; &lt;/security:ldap-authentication-provider&gt; &lt;/security:authentication-manager&gt; &lt;security:ldap-server url="ldap://localhost:10389/o=test" manager-dn="uid=admin,ou=system" manager-password="secret" /&gt; &lt;/beans&gt; </code></pre> <p>And this is the wep.xml</p> <pre><code>&lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt; &lt;display-name&gt;Getting Started with Spring&lt;/display-name&gt; &lt;context-param&gt; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; &lt;param-value&gt; /WEB-INF/spring-security.xml /WEB-INF/applicationContext.xml &lt;!-- /WEB-INF/spring-ldap.xml--&gt; &lt;/param-value&gt; &lt;/context-param&gt; &lt;listener&gt; &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt; &lt;/listener&gt; &lt;servlet&gt; &lt;servlet-name&gt;Spring MVC Servlet&lt;/servlet-name&gt; &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; &lt;param-value&gt;/WEB-INF/spring-mvc-context.xml&lt;/param-value&gt; &lt;/init-param&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Spring MVC Servlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/app/*&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;filter&gt; &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt; &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/filter-mapping&gt; &lt;/web-app&gt; </code></pre> <p>And In apache DS I made a simple structure of users and group of users (admin/user).</p> <p>That is it! If you dont understand something in the code just let me know and I will try to help.. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload