applicationContext-security-ns.xml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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-2.0.xsd
  11. http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd">
  12. <annotation-driven/>
  13. <http>
  14. <intercept-url pattern="/secure/extreme/**" access="ROLE_SUPERVISOR"/>
  15. <intercept-url pattern="/secure/**" access="IS_AUTHENTICATED_REMEMBERED" />
  16. <!-- Disable web URI authorization, as we're using <annotation-driven> and have @Secured the services layer instead
  17. <intercept-url pattern="/listAccounts.html" access="IS_AUTHENTICATED_REMEMBERED" />
  18. <intercept-url pattern="/post.html" access="ROLE_TELLER" />
  19. -->
  20. <intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />
  21. <!--
  22. Uncomment to enable X509 client authentication support -->
  23. <x509 />
  24. <!-- All of this is unnecessary if auto-config="true" -->
  25. <form-login />
  26. <anonymous />
  27. <http-basic />
  28. <logout />
  29. <remember-me />
  30. <concurrent-session-control max-sessions="1" exception-if-maximum-exceeded="true"/>
  31. </http>
  32. <!--
  33. Uncomment to add X509 support as an external filter definition (an alternative to the <x509 /> element).
  34. <beans:bean id="x509Filter" class="org.springframework.security.ui.preauth.x509.X509PreAuthenticatedProcessingFilter" autowire="byType">
  35. <custom-filter after="X509_FILTER"/>
  36. </beans:bean>
  37. <beans:bean id="preauthProvider" class="org.springframework.security.providers.preauth.PreAuthenticatedAuthenticationProvider" >
  38. <custom-authentication-provider />
  39. <beans:property name="preAuthenticatedUserDetailsService">
  40. <beans:bean class="org.springframework.security.providers.preauth.UserDetailsByNameServiceWrapper" autowire="byType"/>
  41. </beans:property>
  42. </beans:bean>
  43. -->
  44. <!--
  45. Usernames/Passwords are
  46. rod/koala
  47. dianne/emu
  48. scott/wombat
  49. -->
  50. <authentication-provider>
  51. <password-encoder hash="md5"/>
  52. <user-service>
  53. <user name="rod" password="a564de63c2d0da68cf47586ee05984d7" authorities="ROLE_SUPERVISOR, ROLE_USER, ROLE_TELLER" />
  54. <user name="dianne" password="65d15fe9156f9c4bbffd98085992a44e" authorities="ROLE_USER,ROLE_TELLER" />
  55. <user name="scott" password="2b58af6dddbd072ed27ffc86725d7d3a" authorities="ROLE_USER" />
  56. </user-service>
  57. </authentication-provider>
  58. </beans:beans>