applicationContext.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
  3. <!--
  4. - These entries must be added to your EXISTING applicationContext.xml.
  5. - This applicationContext.xml cannot be used in its current form. It only
  6. - contains fragments of a real applicationContext.xml.
  7. -
  8. - $Id$
  9. -->
  10. <beans>
  11. <!-- =================== SECURITY BEANS YOU SHOULD CHANGE ================== -->
  12. <!-- If you replace this bean with say JdbcDaoImpl, just ensure your replacement
  13. has the same bean id (authenticationDao) -->
  14. <bean id="authenticationDao" class="net.sf.acegisecurity.providers.dao.memory.InMemoryDaoImpl">
  15. <property name="userMap">
  16. <value>
  17. marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR
  18. dianne=emu,ROLE_TELLER
  19. scott=wombat,ROLE_TELLER
  20. peter=opal,disabled,ROLE_TELLER
  21. </value>
  22. </property>
  23. </bean>
  24. <!-- Note the order that entries are placed against the objectDefinitionSource is critical.
  25. The FilterSecurityInterceptor will work from the top of the list down to the FIRST pattern that matches the request URL.
  26. Accordingly, you should place MOST SPECIFIC (ie a/b/c/d.*) expressions first, with LEAST SPECIFIC (ie a/.*) expressions last -->
  27. <bean id="filterInvocationInterceptor" class="net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor">
  28. <property name="authenticationManager"><ref local="authenticationManager"/></property>
  29. <property name="accessDecisionManager"><ref local="accessDecisionManager"/></property>
  30. <property name="objectDefinitionSource">
  31. <value>
  32. CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
  33. PATTERN_TYPE_APACHE_ANT
  34. /secure/**=ROLE_SUPERVISOR
  35. </value>
  36. </property>
  37. </bean>
  38. <!-- =================== SECURITY BEANS YOU WILL RARELY (IF EVER) CHANGE ================== -->
  39. <bean id="daoAuthenticationProvider" class="net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider">
  40. <property name="authenticationDao"><ref local="authenticationDao"/></property>
  41. <property name="userCache"><ref local="userCache"/></property>
  42. </bean>
  43. <bean id="userCache" class="net.sf.acegisecurity.providers.dao.cache.EhCacheBasedUserCache">
  44. <property name="minutesToIdle"><value>5</value></property>
  45. </bean>
  46. <bean id="authenticationManager" class="net.sf.acegisecurity.providers.ProviderManager">
  47. <property name="providers">
  48. <list>
  49. <ref local="daoAuthenticationProvider"/>
  50. </list>
  51. </property>
  52. </bean>
  53. <bean id="roleVoter" class="net.sf.acegisecurity.vote.RoleVoter"/>
  54. <bean id="accessDecisionManager" class="net.sf.acegisecurity.vote.AffirmativeBased">
  55. <property name="allowIfAllAbstainDecisions"><value>false</value></property>
  56. <property name="decisionVoters">
  57. <list>
  58. <ref local="roleVoter"/>
  59. </list>
  60. </property>
  61. </bean>
  62. <bean id="authenticationProcessingFilter" class="net.sf.acegisecurity.ui.webapp.AuthenticationProcessingFilter">
  63. <property name="authenticationManager"><ref local="authenticationManager"/></property>
  64. <property name="authenticationFailureUrl"><value>/acegilogin.jsp?login_error=1</value></property>
  65. <property name="defaultTargetUrl"><value>/</value></property>
  66. <property name="filterProcessesUrl"><value>/j_acegi_security_check</value></property>
  67. </bean>
  68. <bean id="securityEnforcementFilter" class="net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter">
  69. <property name="filterSecurityInterceptor"><ref local="filterInvocationInterceptor"/></property>
  70. <property name="authenticationEntryPoint"><ref local="authenticationProcessingFilterEntryPoint"/></property>
  71. </bean>
  72. <bean id="authenticationProcessingFilterEntryPoint" class="net.sf.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint">
  73. <property name="loginFormUrl"><value>/acegilogin.jsp</value></property>
  74. <property name="forceHttps"><value>false</value></property>
  75. </bean>
  76. <bean id="autoIntegrationFilter" class="net.sf.acegisecurity.ui.AutoIntegrationFilter" />
  77. </beans>