1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <beans xmlns=
"http://www.springframework.org/schema/beans"
3 xmlns:
sec=
"http://www.springframework.org/schema/security" xmlns:
xsi=
"http://www.w3.org/2001/XMLSchema-instance"
4 xmlns:
aop=
"http://www.springframework.org/schema/aop"
6 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
7 http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">
9 <bean id=
"springSecurityFilterChain" class=
"org.springframework.security.util.FilterChainProxy">
10 <sec:filter-chain-map path-type=
"ant">
11 <sec:filter-chain pattern=
"/**"
12 filters=
"httpSessionContextIntegrationFilter,logoutFilter,basicProcessingFilter,anonymousProcessingFilter,securityContextHolderAwareRequestFilter,exceptionTranslationFilter,filterInvocationInterceptor" />
13 </sec:filter-chain-map>
16 <!-- The actual authorization checks (called last, but first here for ease
18 <bean id=
"filterInvocationInterceptor" parent=
"filterInvocationInterceptorTemplate">
19 <property name=
"objectDefinitionSource">
21 CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
22 PATTERN_TYPE_APACHE_ANT
23 /public/**=IS_AUTHENTICATED_ANONYMOUSLY
27 <!-- CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON -->
28 <!-- PATTERN_TYPE_APACHE_ANT -->
29 <!-- /config/**=ROLE_ADMINISTRATOR -->
30 <!-- /**=IS_AUTHENTICATED_ANONYMOUSLY -->
35 <!-- Integrates the authentication information in the http sessions -->
36 <bean id=
"httpSessionContextIntegrationFilter"
37 class=
"org.springframework.security.context.HttpSessionContextIntegrationFilter">
38 <property name=
"allowSessionCreation" value=
"true" />
41 <!-- Processes logouts, removing both session informations and the remember-me
42 cookie from the browser -->
43 <bean id=
"logoutFilter" class=
"org.springframework.security.ui.logout.LogoutFilter">
44 <constructor-arg value=
"/web/" />
45 <!-- URL redirected to after logout -->
48 <ref bean=
"rememberMeServices" />
50 class=
"org.springframework.security.ui.logout.SecurityContextLogoutHandler" />
55 <!-- Double check, this may not be necessary -->
56 <bean id=
"securityContextHolderAwareRequestFilter"
57 class=
"org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter" />
59 <!-- Use the remember me cookie to authenticate -->
60 <bean id=
"rememberMeProcessingFilter"
61 class=
"org.springframework.security.ui.rememberme.RememberMeProcessingFilter">
62 <property name=
"authenticationManager" ref=
"authenticationManager" />
63 <property name=
"rememberMeServices" ref=
"rememberMeServices" />
66 <bean id=
"rememberMeServices"
67 class=
"org.springframework.security.ui.rememberme.TokenBasedRememberMeServices">
68 <property name=
"userDetailsService" ref=
"userDetailsService" />
69 <property name=
"key" value=
"${argeo.security.systemKey}" />
72 <!-- Basic authentication -->
73 <bean id=
"basicProcessingFilter"
74 class=
"org.springframework.security.ui.basicauth.BasicProcessingFilter">
75 <property name=
"authenticationManager">
76 <ref bean=
"authenticationManager" />
78 <property name=
"authenticationEntryPoint">
79 <ref local=
"basicProcessingFilterEntryPoint" />
81 <property name=
"rememberMeServices" ref=
"rememberMeServices" />
84 <!-- Activate basic auth when needed -->
85 <bean id=
"basicProcessingFilterEntryPoint"
86 class=
"org.springframework.security.ui.basicauth.BasicProcessingFilterEntryPoint">
87 <property name=
"realmName">
92 <!-- If everything else failed, anonymous authentication -->
93 <bean id=
"anonymousProcessingFilter"
94 class=
"org.springframework.security.providers.anonymous.AnonymousProcessingFilter">
95 <property name=
"key" value=
"${argeo.security.systemKey}" />
96 <property name=
"userAttribute" value=
"anonymous,ROLE_ANONYMOUS" />
99 <!-- Reacts to security related exceptions -->
100 <bean id=
"exceptionTranslationFilter"
101 class=
"org.springframework.security.ui.ExceptionTranslationFilter">
102 <property name=
"authenticationEntryPoint">
103 <ref bean=
"basicProcessingFilterEntryPoint" />
105 <property name=
"accessDeniedHandler">
106 <bean class=
"org.springframework.security.ui.AccessDeniedHandlerImpl">
107 <property name=
"errorPage" value=
"/accessDenied.jsp" />
112 <!-- Template for authorization checks -->
113 <bean id=
"filterInvocationInterceptorTemplate" abstract=
"true"
114 class=
"org.springframework.security.intercept.web.FilterSecurityInterceptor">
115 <property name=
"authenticationManager" ref=
"authenticationManager" />
116 <property name=
"accessDecisionManager">
117 <bean class=
"org.springframework.security.vote.AffirmativeBased">
118 <property name=
"allowIfAllAbstainDecisions" value=
"false" />
119 <property name=
"decisionVoters">
121 <bean class=
"org.springframework.security.vote.RoleVoter" />
122 <bean class=
"org.springframework.security.vote.AuthenticatedVoter" />