diff --git a/samples/ldap/pom.xml b/samples/ldap/pom.xml
new file mode 100644
index 0000000000..9a01aa8720
--- /dev/null
+++ b/samples/ldap/pom.xml
@@ -0,0 +1,92 @@
+
+ 4.0.0
+
+ org.springframework.security
+ spring-security-samples
+ 2.0-SNAPSHOT
+
+ org.springframework.security
+ spring-security-samples-ldap
+ Spring Security - Ldap Sample
+ war
+
+
+ org.springframework.security
+ spring-security-core
+ ${project.version}
+
+
+ org.springframework.security
+ spring-security-core-tiger
+ ${project.version}
+
+
+ org.springframework
+ spring-web
+
+
+ org.springframework
+ spring-webmvc
+ ${spring.version}
+
+
+ org.springframework
+ spring-jdbc
+ runtime
+
+
+ org.springframework
+ spring-aop
+ runtime
+
+
+ org.apache.directory.server
+ apacheds-core
+ 1.0.2
+ compile
+ true
+
+
+ org.apache.directory.server
+ apacheds-server-jndi
+ 1.0.2
+ compile
+ true
+
+
+ org.slf4j
+ slf4j-log4j12
+ 1.4.3
+ runtime
+ true
+
+
+ org.springframework.ldap
+ spring-ldap
+ 1.2.1
+ true
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ 1.5
+ 1.5
+
+
+
+ org.mortbay.jetty
+ maven-jetty-plugin
+ 6.1.7
+
+ /ldap
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/ldap/src/main/webapp/WEB-INF/applicationContext-security.xml b/samples/ldap/src/main/webapp/WEB-INF/applicationContext-security.xml
new file mode 100644
index 0000000000..66c3569767
--- /dev/null
+++ b/samples/ldap/src/main/webapp/WEB-INF/applicationContext-security.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/ldap/src/main/webapp/WEB-INF/classes/log4j.properties b/samples/ldap/src/main/webapp/WEB-INF/classes/log4j.properties
new file mode 100644
index 0000000000..511c3cf98f
--- /dev/null
+++ b/samples/ldap/src/main/webapp/WEB-INF/classes/log4j.properties
@@ -0,0 +1,20 @@
+# Global logging configuration
+log4j.rootLogger=INFO, stdout, fileout
+
+log4j.logger.org.springframework.security=DEBUG, stdout, fileout
+
+# Console output...
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.conversionPattern=[%p,%c{1},%t] %m%n
+
+# Rolling log file output...
+log4j.appender.fileout=org.apache.log4j.RollingFileAppender
+log4j.appender.fileout.File=spring-security-ldap.log
+#log4j.appender.fileout.File=${webapp.root}/WEB-INF/log4j.log
+log4j.appender.fileout.MaxFileSize=1024KB
+log4j.appender.fileout.MaxBackupIndex=1
+log4j.appender.fileout.layout=org.apache.log4j.PatternLayout
+log4j.appender.fileout.layout.conversionPattern=%d{ABSOLUTE} %5p %c{1},%t:%L - %m%n
+
+
diff --git a/samples/ldap/src/main/webapp/WEB-INF/classes/users.ldif b/samples/ldap/src/main/webapp/WEB-INF/classes/users.ldif
new file mode 100644
index 0000000000..0cf02e22ec
--- /dev/null
+++ b/samples/ldap/src/main/webapp/WEB-INF/classes/users.ldif
@@ -0,0 +1,60 @@
+dn: ou=groups,dc=springframework,dc=org
+objectclass: top
+objectclass: organizationalUnit
+ou: groups
+
+dn: ou=people,dc=springframework,dc=org
+objectclass: top
+objectclass: organizationalUnit
+ou: people
+
+dn: uid=rod,ou=people,dc=springframework,dc=org
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+cn: Rod Johnson
+sn: Johnson
+uid: rod
+userPassword: koala
+
+dn: uid=dianne,ou=people,dc=springframework,dc=org
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+cn: Dianne Emu
+sn: Emu
+uid: dianne
+userPassword: emu
+
+dn: uid=scott,ou=people,dc=springframework,dc=org
+objectclass: top
+objectclass: person
+objectclass: organizationalPerson
+objectclass: inetOrgPerson
+cn: Scott
+sn: Wombat
+uid: scott
+userPassword: wombat
+
+dn: cn=user,ou=groups,dc=springframework,dc=org
+objectclass: top
+objectclass: groupOfNames
+cn: user
+member: uid=rod,ou=people,dc=springframework,dc=org
+member: uid=dianne,ou=people,dc=springframework,dc=org
+member: uid=scott,ou=people,dc=springframework,dc=org
+
+dn: cn=teller,ou=groups,dc=springframework,dc=org
+objectclass: top
+objectclass: groupOfNames
+cn: teller
+member: uid=rod,ou=people,dc=springframework,dc=org
+member: dianne=rod,ou=people,dc=springframework,dc=org
+
+dn: cn=supervisor,ou=groups,dc=springframework,dc=org
+objectclass: top
+objectclass: groupOfNames
+cn: supervisor
+member: uid=rod,ou=people,dc=springframework,dc=org
diff --git a/samples/ldap/src/main/webapp/WEB-INF/web.xml b/samples/ldap/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..7369c903d3
--- /dev/null
+++ b/samples/ldap/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+ Spring Security Preauthentication Demo Application
+
+
+
+ contextConfigLocation
+
+ /WEB-INF/applicationContext-security.xml
+
+
+
+
+ springSecurityFilterChain
+ org.springframework.web.filter.DelegatingFilterProxy
+
+
+
+ springSecurityFilterChain
+ /*
+
+
+
+
+ org.springframework.web.context.ContextLoaderListener
+
+
+
+
+ org.springframework.security.ui.session.HttpSessionEventPublisher
+
+
+
diff --git a/samples/ldap/src/main/webapp/index.jsp b/samples/ldap/src/main/webapp/index.jsp
new file mode 100644
index 0000000000..9f056599b6
--- /dev/null
+++ b/samples/ldap/src/main/webapp/index.jsp
@@ -0,0 +1,11 @@
+
+
+Home Page
+Anyone can view this page.
+
+Your principal object is....: <%= request.getUserPrincipal() %>
+
+Secure page
+Extremely secure page
+
+
\ No newline at end of file
diff --git a/samples/ldap/src/main/webapp/secure/extreme/index.jsp b/samples/ldap/src/main/webapp/secure/extreme/index.jsp
new file mode 100644
index 0000000000..5cc73bb8b6
--- /dev/null
+++ b/samples/ldap/src/main/webapp/secure/extreme/index.jsp
@@ -0,0 +1,10 @@
+
+
+
+VERY Secure Page
+This is a protected page. You can only see me if you are a supervisor.
+
+Home
+
Logout
+
+
\ No newline at end of file
diff --git a/samples/ldap/src/main/webapp/secure/index.jsp b/samples/ldap/src/main/webapp/secure/index.jsp
new file mode 100644
index 0000000000..b774c40ed8
--- /dev/null
+++ b/samples/ldap/src/main/webapp/secure/index.jsp
@@ -0,0 +1,15 @@
+
+
+Secure Page
+This is a protected page. You can get to me if you've been remembered,
+or if you've authenticated this session.
+
+<%if (request.isUserInRole("ROLE_SUPERVISOR")) { %>
+ You are a supervisor! You can therefore see the extremely secure page .
+<% } %>
+
+
+Home
+
Logout
+
+
\ No newline at end of file