applicationContext-security.xml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. - Sample namespace-based configuration
  4. -
  5. - $Id$
  6. -->
  7. <beans:beans xmlns="http://www.springframework.org/schema/security"
  8. xmlns:beans="http://www.springframework.org/schema/beans"
  9. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  10. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  11. http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
  12. <global-method-security pre-post-annotations="enabled">
  13. <!-- AspectJ pointcut expression that locates our "post" method and applies security that way
  14. <protect-pointcut expression="execution(* bigbank.*Service.post*(..))" access="ROLE_TELLER"/>
  15. -->
  16. </global-method-security>
  17. <http use-expressions="true">
  18. <intercept-url pattern="/secure/extreme/**" access="hasRole('ROLE_SUPERVISOR')"/>
  19. <intercept-url pattern="/secure/**" access="isAuthenticated()" />
  20. <!-- Disable web URI authorization, as we're using <global-method-security> and have @Secured the services layer instead
  21. <intercept-url pattern="/listAccounts.html" access="isRememberMe()" />
  22. <intercept-url pattern="/post.html" access="hasRole('ROLE_TELLER')" />
  23. -->
  24. <intercept-url pattern="/**" access="permitAll" />
  25. <form-login />
  26. <logout />
  27. <remember-me />
  28. <!--
  29. Uncomment to enable X509 client authentication support
  30. <x509 />
  31. -->
  32. <!-- Uncomment to limit the number of sessions a user can have -->
  33. <session-management>
  34. <concurrency-control max-sessions="1" error-if-maximum-exceeded="true" />
  35. </session-management>
  36. </http>
  37. <!--
  38. Usernames/Passwords are
  39. rod/koala
  40. dianne/emu
  41. scott/wombat
  42. peter/opal
  43. -->
  44. <authentication-manager>
  45. <authentication-provider>
  46. <password-encoder hash="md5"/>
  47. <user-service>
  48. <user name="rod" password="a564de63c2d0da68cf47586ee05984d7" authorities="ROLE_SUPERVISOR, ROLE_USER, ROLE_TELLER" />
  49. <user name="dianne" password="65d15fe9156f9c4bbffd98085992a44e" authorities="ROLE_USER,ROLE_TELLER" />
  50. <user name="scott" password="2b58af6dddbd072ed27ffc86725d7d3a" authorities="ROLE_USER" />
  51. <user name="peter" password="22b5c9accc6e1ba628cedc63a72d57f8" authorities="ROLE_USER" />
  52. </user-service>
  53. </authentication-provider>
  54. </authentication-manager>
  55. </beans:beans>