Browse Source

Removed auto-config from tutorial sample and added commented out ldap support. Updated ldif file to match sample users.

Luke Taylor 17 years ago
parent
commit
342677fabc

+ 18 - 10
samples/tutorial/src/main/webapp/WEB-INF/applicationContext-security-ns.xml

@@ -14,7 +14,7 @@
 
 	<annotation-driven/>
 
-    <http auto-config="true">
+    <http>
         <intercept-url pattern="/secure/extreme/**" access="ROLE_SUPERVISOR"/>
         <intercept-url pattern="/secure/**" access="IS_AUTHENTICATED_REMEMBERED" />
 		<!-- Disable web URI authorization, as we're using <annotation-driven> and have @Secured the services layer instead
@@ -23,27 +23,35 @@
         -->
         <intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />
 
-		<!-- All of this is unnecessary if auto-config="true"
+		<!-- All of this is unnecessary if auto-config="true" -->
         <form-login />
         <anonymous />
         <http-basic />
         <logout />
         <remember-me />
- 		<servlet-api-integration />
- 		-->
 
         <concurrent-session-control max-sessions="1" exception-if-maximum-exceeded="true"/>
 
     </http>
 
-	<authentication-provider>
+
+    <!--
+    Usernames/Passwords are
+        rod/koala
+        dianne/emu
+        scott/wombat
+    -->
+<!--
+    <ldap-server ldif="classpath:users.ldif" />
+    <ldap-authentication-provider />
+-->
+
+    <authentication-provider>
         <password-encoder hash="md5"/>
         <user-service>
-	        <user name="rod" password="a564de63c2d0da68cf47586ee05984d7" authorities="ROLE_SUPERVISOR,ROLE_USER,ROLE_TELLER" /> <!--  koala -->
-	        <user name="dianne" password="65d15fe9156f9c4bbffd98085992a44e" authorities="ROLE_USER,ROLE_TELLER" /> <!--  emu -->
-	        <user name="scott" password="2b58af6dddbd072ed27ffc86725d7d3a" authorities="ROLE_USER" /> <!--  wombat -->
-	        <user name="peter" password="22b5c9accc6e1ba628cedc63a72d57f8" authorities="ROLE_USER" /> <!--  opal -->
+            <user name="rod" password="a564de63c2d0da68cf47586ee05984d7" authorities="ROLE_SUPERVISOR,ROLE_USER,ROLE_TELLER" />
+	        <user name="dianne" password="65d15fe9156f9c4bbffd98085992a44e" authorities="ROLE_USER,ROLE_TELLER" />
+            <user name="scott" password="2b58af6dddbd072ed27ffc86725d7d3a" authorities="ROLE_USER" />
 	    </user-service>
 	</authentication-provider>
-
 </beans:beans>

+ 23 - 0
samples/tutorial/src/main/webapp/WEB-INF/classes/users.ldif

@@ -18,17 +18,40 @@ 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