Spring Security权限管理相关配置加注解

xml version="1.0" encoding="UTF-8"?>
xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:security="http://www.springframework.org/schema/security"
       xmlns:beans="http://www.springframework.org/schema/beans"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/security
       http://www.springframework.org/schema/security/spring-security.xsd">

       
       <security:http security="none" pattern="/statics/**" />
       <security:http security="none" pattern="/public/**"/>
       <security:http security="none" pattern="/login*"/>
       <security:http security="none" pattern="/maxSessionError*"/>
       <security:http security="none" pattern="/forbidden*"/>
       
       <security:http use-expressions="true">
              
              <security:intercept-url pattern="/**" access="isAuthenticated()"/>
              

              

              
              
              
              
              
              
              
              
              
              
              
              

              <security:form-login login-page="/login"
                                   default-target-url="/home"
                                   authentication-failure-url="/login"
                                   authentication-success-handler-ref="loginSuccessHandler"/>
              
              <security:logout invalidate-session="true" delete-cookies="true" success-handler-ref="logoutSuccessHandler"/>
              
              <security:access-denied-handler error-page="/forbidden"/>
              
              <security:session-management session-fixation-protection="newSession" invalid-session-url="/sessionTimeOut.htm">
                     
                     <security:concurrency-control max-sessions="1" error-if-maximum-exceeded="false" expired-url="/maxSessionError.htm"/>
              security:session-management>
              
              <security:custom-filter ref="myFilter" before="FILTER_SECURITY_INTERCEPTOR"/>
       security:http>

       
       
       
       <security:authentication-manager alias="authenticationManager">
              
              <security:authentication-provider user-service-ref="userInfoProvider">
                     
                     <security:password-encoder hash="md5" base64="true"/>
                     
                            
                     
              security:authentication-provider>
       security:authentication-manager>

       
       <beans:bean id="myFilter" class="com.flx.base.filter.MyFilterSecurityInterceptor">
              <beans:property name="authenticationManager" ref="authenticationManager"/>
              <beans:property name="accessDecisionManager" ref="accessDecisionManager"/>
              <beans:property name="securityMetadataSource" ref="securityMetadataSource"/>
       beans:bean>

       
       <beans:bean id="userInfoProvider" class="com.flx.base.security.secuser.service.impl.UserInfoServiceImpl"/>

       
       <beans:bean id="securityMetadataSource" class="com.flx.base.filter.MySecurityMetadataSource"/>

       
       <beans:bean id="accessDecisionManager" class="com.flx.base.filter.MyAccessDesisionmanager"/>


       
       id="loginSuccessHandler" class="com.flx.base.handler.MyLoginSuccessHandler"/>
       
       id="logoutSuccessHandler" class="com.flx.base.handler.MyLogoutSuccessHandler"/>
       
       id="loginFailHandler" class="com.flx.base.handler.MyLoginFailHandler"/>

你可能感兴趣的:(权限框架)