当前位置:网站首页>1.03 original Acegi security mechanism
1.03 original Acegi security mechanism
2022-07-30 07:08:00 【victorkevin】
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
- <beans>
- <!-- Acegi security-->
- <!-- FilterChainProxy -->
- <!--注意:When configuring, arrange the order of filter chain processing according to business requirements-->
- <bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy">
- <property name="filterInvocationDefinitionSource">
- <value>
- CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
- PATTERN_TYPE_APACHE_ANT
- /**=httpSessionContextIntegrationFilter,authenticationProcessingFilter,securityContextHolderAwareRequestFilter,remeberMeProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilter,filterSecurityInterceptor
- </value>
- </property>
- </bean>
- <!-- Channel Servlet 过滤器 -->
- <bean id="channelProcessingFilter" class="org.acegisecurity.securechannel.ChannelProcessingFilter">
- <property name="channelDecisionManager">
- <ref bean="channelDecisionManager"/>
- </property>
- <property name="filterInvocationDefinitionSource">
- <value>
- CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
- PATTERN_TYPE_APACHE_ANT
- /usersjsp/**=REQUIRES_INSECURE_CHANNEL
- /*.do=REQUIRES_INSECURE_CHANNEL
- /*=REQUIRES_INSECURE_CHANNEL
- </value>
- </property>
- </bean>
- <bean id="channelDecisionManager" class="org.acegisecurity.securechannel.ChannelDecisionManagerImpl">
- <property name="channelProcessors">
- <list>
- <ref bean="secureChannelProcessor"/>
- <ref bean="insecureChannelProcessor"/>
- </list>
- </property>
- </bean>
- <bean id="secureChannelProcessor" class="org.acegisecurity.securechannel.SecureChannelProcessor"></bean>
- <bean id="insecureChannelProcessor" class="org.acegisecurity.securechannel.InsecureChannelProcessor"/>
- <!-- LogOut Filter -->
- <!-- SecurityContextHolderAwareRequestFilter 过滤器 -->
- <bean id="securityContextHolderAwareRequestFilter" class="org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter">
- </bean>
- <!-- ExceptionTranslationFilter 过滤器 -->
- <bean id="exceptionTranslationFilter" class="org.acegisecurity.ui.ExceptionTranslationFilter">
- <property name="authenticationEntryPoint">
- <ref local="authenticationProcessingFilterEntryPoint"/>
- </property>
- <property name="accessDeniedHandler">
- <bean class="org.acegisecurity.ui.AccessDeniedHandlerImpl">
- <property name="errorPage" value="/ErrorJSP/accessDenied.jsp"/>
- </bean>
- </property>
- </bean>
- <bean id="authenticationProcessingFilterEntryPoint" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint">
- <property name="loginFormUrl"><value>/security/SecurityLogin.jsp?error=2</value></property>
- <property name="forceHttps"><value>false</value></property>
- </bean>
- <!-- Authenication Process Filter 过滤器 -->
- <bean id="authenticationProcessingFilter" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter">
- <property name="filterProcessesUrl">
- <value>/security/j_acegi_security_check</value>
- </property>
- <property name="authenticationManager">
- <ref local="authenticationManager"/>
- </property>
- <property name="defaultTargetUrl">
- <value>/forumShow.do</value>
- </property>
- <property name="authenticationFailureUrl">
- <value>/security/SecurityLogin.jsp?error=1</value>
- </property>
- <property name="rememberMeServices">
- <ref local="rememberMeServices"/>
- </property>
- </bean>
- <!-- DAO authentication Provider -->
- <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
- <property name="userDetailsService"><ref local="userDetailsService"/></property>
- </bean>
- <!-- In memory DAO Implmention -->
- <bean id="userDetailsService" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
- <property name="userMap">
- <value>
- victor=1234,ROLE_SUPERVISOR
- kevin=1234,ROLE_USER
- </value>
- </property>
- </bean>
- <!-- Concurrent Session Controller -->
- <bean id="concurrentSessionController" class="org.acegisecurity.concurrent.ConcurrentSessionControllerImpl">
- <property name="maximumSessions"><value>1</value></property>
- <property name="sessionRegistry">
- <bean class="org.acegisecurity.concurrent.SessionRegistryImpl"></bean>
- </property>
- </bean>
- <!-- HttpSession Integration Filter-->
- <bean id="httpSessionContextIntegrationFilter" class="org.acegisecurity.context.HttpSessionContextIntegrationFilter">
- </bean>
- <!-- 过滤安全拦截器 -->
- <bean id="filterSecurityInterceptor" class="org.acegisecurity.intercept.web.FilterSecurityInterceptor">
- <property name="authenticationManager">
- <ref local="authenticationManager"/>
- </property>
- <property name="accessDecisionManager">
- <ref local="accessDecisionManager"/>
- </property>
- <property name="objectDefinitionSource">
- <value>
- CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
- PATTERN_TYPE_APACHE_ANT
- /security/securitylogin.jsp=ROLE_ANONYMOUS,ROLE_SUPERVISOR
- /forumshow.do=ROLE_ANONYMOUS,ROLE_SUPERVISOR,ROLE_USER
- /viewjsp/index.jsp=ROLE_ANONYMOUS,ROLE_SUPERVISOR,ROLE_USER
- /**=ROLE_SUPERVISOR,ROLE_ANONYMOUS
- </value>
- </property>
- </bean>
- <!--================== Access decision Manager ======================-->
- <bean id="accessDecisionManager" class="org.acegisecurity.vote.AffirmativeBased">
- <property name="decisionVoters">
- <list>
- <ref bean="roleVoter"/>
- </list>
- </property>
- <property name="allowIfAllAbstainDecisions">
- <value>false</value>
- </property>
- </bean>
- <!-- Role voter -->
- <bean id="roleVoter" class="org.acegisecurity.vote.RoleVoter"></bean>
- <!-- Authenication Manager -->
- <bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager">
- <property name="providers">
- <list>
- <ref local="daoAuthenticationProvider"/>
- <bean class="org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider">
- <property name="key" value="changeThis"></property>
- </bean>
- <bean class="org.acegisecurity.providers.rememberme.RememberMeAuthenticationProvider">
- <property name="key">
- <value>victorOK</value>
- </property>
- </bean>
- </list>
- </property>
- </bean>
- <!-- Remember me Process Filter -->
- <bean id="remeberMeProcessingFilter" class="org.acegisecurity.ui.rememberme.RememberMeProcessingFilter">
- <property name="authenticationManager">
- <ref local="authenticationManager"/>
- </property>
- <property name="rememberMeServices">
- <ref local="rememberMeServices"/>
- </property>
- </bean>
- <bean id="rememberMeServices" class="org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices">
- <property name="userDetailsService">
- <ref local="userDetailsService"/>
- </property>
- <property name="key">
- <value>victor</value>
- </property>
- </bean>
- <!-- 密码 编码器 -->
- <bean id="passwordEncoder" class="org.acegisecurity.providers.encoding.Md5PasswordEncoder"></bean>
- <!-- 登录事件监听器 -->
- <bean id="loggerListener" class="org.acegisecurity.event.authentication.LoggerListener"></bean>
- <!-- 匿名 过滤器 -->
- <bean id="anonymousProcessingFilter" class="org.acegisecurity.providers.anonymous.AnonymousProcessingFilter">
- <property name="key">
- <value>victorOK</value>
- </property>
- <property name="userAttribute">
- <value>anonymousUser,ROLE_ANONYMOUS</value>
- </property>
- </bean>
- </beans>
边栏推荐
- MySQL special statement and optimizer
- 基于R语言地理加权回归、主成分分析、判别分析等空间异质性数据分析
- 原创 Acegi 1.03 安全机制
- MySQL 5.7 安装教程(全步骤、保姆级教程)
- Arthas 命令解析(jvm/thread/stack/heapdump)
- 边境的悍匪—机器学习实战:第十章 Keras人工神经网络简介
- 卷积神经网络(CNN)之卷积操作、池化操作、激活函数
- 【十年网络安全工程师整理】—100渗透测试工具使用方法介绍
- mysql delete duplicate data in the table, (retain only one row)
- 常用损失函数(一):Focal Loss
猜你喜欢

Redis publish/subscribe

Thread state of five

边境的悍匪—机器学习实战:第九章 无监督学习任务

十九、Kotlin进阶学习:1、管道数据的收和发;2、管道的关闭;3、生产者和消费者;4、管道的缓存区;

Servlet基本原理与常见API方法的应用

Trust anchor for certification path not found.异常解决方法。

mysql is not an internal or external command, nor is it a runnable program or batch file to resolve

边境的悍匪—机器学习实战:第十章 Keras人工神经网络简介

建造者模式(Swift 实现)

"MySQL Advanced Chapter" four, the storage structure of the index
随机推荐
MYSQL一站式学习,看完即学完
MATLAB怎么在图像中显示nii文件切片信息?
函数的信息传递(C语言实践)
Servlet basic principles and application of common API methods
原创 Acegi 1.03 安全机制
边境的悍匪—机器学习实战:第十五章 使用CNN和RNN处理序列
Mysql 客户端常见异常分析
Pytorch(三):可视化工具(Tensorboard、Visdom)
原型模式(Prototype):Swift 实现
常用损失函数(一):Focal Loss
MySQL index optimization and failure scenarios
sql concat() function
C语言实战小项目(传统卡牌游戏)
二十一、Kotlin进阶学习:实现简单的网络访问封装
Rsync realizes folder or data synchronization between Win systems
Mysql client common exception analysis
二叉树(一):深度优先遍历与广度优先遍历
Usage of exists in sql
protobuf coding and network communication applications (1)
正则表达式语法详解及实用实例