Acegi Security在Appfuse1.9.4中的应用

小弟初来研究Appfuse,请多指教!!!

Acegi源码分析<o:p></o:p>

<o:p> </o:p>

Spring框架配置文件信息--> <o:p></o:p>

xml version="1.0" encoding="UTF-8"?><o:p></o:p>

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<o:p></o:p>

       xmlns:aop="http://www.springframework.org/schema/aop"<o:p></o:p>

       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd<o:p></o:p>

            http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"><o:p></o:p>

<o:p> </o:p>

<o:p></o:p>

  <o:p></o:p>

  <o:p></o:p>

<bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy"><o:p></o:p>

        <property name="filterInvocationDefinitionSource"><o:p></o:p>

            <value><o:p></o:p>

             在比较请求路径前,全部转化为小写--><o:p></o:p>

                CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON<o:p></o:p>

               定义使用apache ant 的匹配模式--> <o:p></o:p>

               PATTERN_TYPE_APACHE_ANT<o:p></o:p>

                /**=httpSessionContextIntegrationFilter,logoutFilter,authenticationProcessingFilter,securityContextHolderAwareRequestFilter,rememberMeProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor<o:p></o:p>

            value><o:p></o:p>

            <o:p></o:p>

            <o:p></o:p>

        property><o:p></o:p>

    bean><o:p></o:p>

Http安全请求,每次request httpsessioncontextintegrationfiltersession中获取authentication对象,在request完后, 又把authentication对象保存到session中供下次request使用,filter必须在其他acegi filter前使用,使之能跨越多个请求。<o:p></o:p>

--><o:p></o:p>

    <bean id="httpSessionContextIntegrationFilter" class="org.acegisecurity.context.HttpSessionContextIntegrationFilter"/><o:p></o:p>

<o:p> </o:p>

    <bean id="logoutFilter" class="org.acegisecurity.ui.logout.LogoutFilter"><o:p></o:p>

        <constructor-arg value="/index.jsp"/> <o:p></o:p>

        <constructor-arg><o:p></o:p>

            <list><o:p></o:p>

                <ref bean="rememberMeServices"/><o:p></o:p>

                <bean class="org.acegisecurity.ui.logout.SecurityContextLogoutHandler"/><o:p></o:p>

            list><o:p></o:p>

        constructor-arg><o:p></o:p>

        <property name="filterProcessesUrl" value="/logout.jsp"/><o:p></o:p>

    bean><o:p></o:p>

authenticationProcessingFilter servlet spec差不多,处理登陆请求,当身份验证成功时,AuthenticationProcessingFilter会在会话中放置一个Authentication对象,并且重定向到登陆成功页面<o:p></o:p>

authenticationFailureUrl 定义登录失败时转向的页面<o:p></o:p>

defaultTargetUrl 定义登录成功时转向的页面<o:p></o:p>

filterProcessesUrl 定义登录请求页面<o:p></o:p>

rememberMeServices 用于在严正成功后添加cookie信息<o:p></o:p>

--><o:p></o:p>

<bean id="authenticationProcessingFilter" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter"><o:p></o:p>

<o:p></o:p>

        <property name="authenticationManager" ref="authenticationManager"/><o:p></o:p>

        <property name="authenticationFailureUrl" value="/login.jsp?error=true"/><o:p></o:p>

        <property name="defaultTargetUrl" value="/"/><o:p></o:p>

        <property name="filterProcessesUrl"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值