<!-- 退出
-->
<bean id="logoutFilter" class="org.acegisecurity.ui.logout.LogoutFilter">
<constructor-arg
value="/index.jsp" />
<constructor-arg>
<list>
<ref
local="rememberMeServices" />
<ref
local="securityContextLogoutHandler" />
</list>
</constructor-arg>
</bean>
<bean id="securityContextLogoutHandler"
class="org.acegisecurity.ui.logout.SecurityContextLogoutHandler">
<property
name="invalidateHttpSession" value="true" />
</bean>
<!-- HTTP基本认证
-->
<bean id="basicProcessionFilter"
class="org.acegisecurity.ui.basicauth.BasicProcessingFilter">
<property
name="authenticationManager" ref="authenticationManager"
/>
<property
name="authenticationEntryPoint"
ref="basicProssingFilterEntryPoint" />
<property
name="rememberMeServices" ref="rememberMeServices" />
</bean>
<!-- 认证管理器 -->
<bean id="authenticationManager"
class="org.acegisecurity.providers.ProviderManager">
<property
name="providers">
<list>
<ref
local="daoAuthenticationProvider" />
<ref
local="anonymousAuthenticationProvider"
/>
<ref
local="rememberMeAuthenticationProvider"
/>
</list>
</property>
</bean>
<!-- DAO认证源提供者 -->
<bean id="daoAuthenticationProvider"
class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property
name="userDetailsService" ref="inMemDaoImpl" />
</bean>
<!-- 用户信息提供者(内存) -->
<bean id="inMemDaoImpl"
class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
<property
name="userMap">
<value>admin=password,ROLE_ADMIN</value>
</property>
</bean>
<!-- HTTP基本认证入口点 -->
<bean
id="basicProssingFilterEntryPoint" class="org.acegisecurity.ui.basicauth.BasicProcessingFilterEntryPoint">
<property
name="realmName" value="Acegi Demo Realm" />
</bean>
<!-- 免登录认证 -->
<bean id="rememberMeProcessingFilter"
class="org.acegisecurity.ui.rememberme.RememberMeProcessingFilter">
<property
name="authenticationManager" ref="authenticationManager"
/>
<property
name="rememberMeServices" ref="rememberMeServices" />
</bean>
<!-- 免登录服务 -->
<bean id="rememberMeServices"
class="org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices">
<property
name="userDetailsService" ref="inMemDaoImpl" />
<property
name="key" value="springRocks" />
<property
name="alwaysRemember" value="true" />
</bean>
<!-- 免登录认证源提供者 -->
<bean id="rememberMeAuthenticationProvider"
class="org.acegisecurity.providers.rememberme.RememberMeAuthenticationProvider">
<property
name="key" value="springRocks" />
</bean>
<!-- 匿名认证
-->
<bean id="anonymousProcessingFilter"
class="org.acegisecurity.providers.anonymous.AnonymousProcessingFilter">
<property
name="key" value="foobar" />
<property
name="userAttribute" value="anonymousUser,ROLE_ANONYMOUS"
/>
</bean>
<!-- 匿名认证源提供者 -->
<bean id="anonymousAuthenticationProvider"
class="org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider">
<property
name="key" value="foobar" />
</bean>