2
0

applicationContext-security.xml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. - Sample namespace-based configuration
  4. -
  5. -->
  6. <beans:beans xmlns="http://www.springframework.org/schema/security"
  7. xmlns:beans="http://www.springframework.org/schema/beans"
  8. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  9. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  10. http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">
  11. <debug />
  12. <global-method-security pre-post-annotations="enabled" />
  13. <http pattern="/loggedout.jsp" security="none"/>
  14. <http use-expressions="true">
  15. <intercept-url pattern="/secure/extreme/**" access="hasRole('ROLE_SUPERVISOR')"/>
  16. <intercept-url pattern="/secure/**" access="isAuthenticated()" />
  17. <!--
  18. Allow all other requests. In a real application you should
  19. adopt a whitelisting approach where access is not allowed by default
  20. -->
  21. <intercept-url pattern="/**" access="permitAll" />
  22. <form-login />
  23. <logout logout-success-url="/loggedout.jsp" delete-cookies="JSESSIONID"/>
  24. <remember-me />
  25. <!--
  26. Uncomment to enable X509 client authentication support
  27. <x509 />
  28. -->
  29. <!-- Uncomment to limit the number of sessions a user can have -->
  30. <session-management invalid-session-url="/timeout.jsp">
  31. <concurrency-control max-sessions="1" error-if-maximum-exceeded="true" />
  32. </session-management>
  33. </http>
  34. <!--
  35. Usernames/Passwords are
  36. rod/koala
  37. dianne/emu
  38. scott/wombat
  39. peter/opal
  40. -->
  41. <authentication-manager>
  42. <authentication-provider>
  43. <password-encoder hash="md5"/>
  44. <user-service>
  45. <user name="rod" password="a564de63c2d0da68cf47586ee05984d7" authorities="ROLE_SUPERVISOR, ROLE_USER, ROLE_TELLER" />
  46. <user name="dianne" password="65d15fe9156f9c4bbffd98085992a44e" authorities="ROLE_USER,ROLE_TELLER" />
  47. <user name="scott" password="2b58af6dddbd072ed27ffc86725d7d3a" authorities="ROLE_USER" />
  48. <user name="peter" password="22b5c9accc6e1ba628cedc63a72d57f8" authorities="ROLE_USER" />
  49. </user-service>
  50. </authentication-provider>
  51. </authentication-manager>
  52. </beans:beans>