聽聽聽聽聽聽聽聽
Acegi 鐨勯厤緗湅璧鋒潵闈炲父澶嶆潅,浣嗕簨瀹炰笂鍦ㄥ疄闄呴」鐩殑瀹夊叏搴旂敤涓垜浠茍涓嶉渶瑕侀偅涔堝鍔熻兘,娓呮鐨勪簡瑙cegi閰嶇疆涓悇欏圭殑鍔熻兘錛屾湁鍔╀簬鎴戜滑鐏墊椿鐨勮繍鐢ˋcegi浜庡疄璺典腑銆?/p>
2.1 鍦╓eb.xml涓殑閰嶇疆
1)聽 FilterToBeanProxy
銆銆Acegi閫氳繃瀹炵幇浜咶ilter鎺ュ彛鐨凢ilterToBeanProxy鎻愪緵涓縐嶇壒孌婄殑浣跨敤Servlet Filter鐨勬柟寮忥紝瀹冨鎵楽pring涓殑Bean -- FilterChainProxy鏉ュ畬鎴愯繃婊ゅ姛鑳斤紝榪欏ソ澶勬槸綆鍖栦簡web.xml鐨勯厤緗紝騫朵笖鍏呭垎鍒╃敤浜哠pring IOC鐨勪紭鍔褲侳ilterChainProxy鍖呭惈浜嗗鐞嗚璇佽繃紼嬬殑filter鍒楄〃錛屾瘡涓猣ilter閮芥湁鍚勮嚜鐨勫姛鑳姐?/p>
聽 聽 <filter>
聽聽聽聽聽聽聽 <filter-name>Acegi Filter Chain Proxy</filter-name>
聽聽聽聽聽聽聽 <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
聽聽聽聽聽聽聽 <init-param>
聽聽聽聽聽聽聽聽聽聽聽 <param-name>targetClass</param-name>
聽聽聽聽聽聽聽聽聽聽聽 <param-value>org.acegisecurity.util.FilterChainProxy</param-value>
聽聽聽聽聽聽聽 </init-param>
聽聽聽 </filter>
2) filter-mapping
銆銆<filter-mapping>闄愬畾浜咶ilterToBeanProxy鐨刄RL鍖歸厤妯″紡,鍙湁*.do鍜?.jsp鍜?j_acegi_security_check 鐨勮姹傛墠浼氬彈鍒版潈闄愭帶鍒訛紝瀵筳avascript,css絳変笉闄愬埗銆?/p>
聽聽 <filter-mapping>
聽聽聽聽聽 <filter-name>Acegi Filter Chain Proxy</filter-name>
聽聽聽聽聽 <url-pattern>*.do</url-pattern>
聽聽聽 </filter-mapping>
聽聽聽
聽聽聽 <filter-mapping>
聽聽聽聽聽 <filter-name>Acegi Filter Chain Proxy</filter-name>
聽聽聽聽聽 <url-pattern>*.jsp</url-pattern>
聽聽聽 </filter-mapping>
聽聽聽
聽聽聽 <filter-mapping>
聽聽聽聽聽 <filter-name>Acegi Filter Chain Proxy</filter-name>
聽聽聽聽聽 <url-pattern>/j_acegi_security_check</url-pattern>
</filter-mapping>
3) HttpSessionEventPublisher
銆銆<listener>鐨凥ttpSessionEventPublisher鐢ㄤ簬鍙戝竷HttpSessionApplicationEvents鍜孒ttpSessionDestroyedEvent浜嬩歡緇檚pring鐨刟pplicationcontext銆?/p>
聽聽聽 <listener>
聽聽聽聽聽聽聽 <listener-class>org.acegisecurity.ui.session.HttpSessionEventPublisher</listener-class>
聽聽聽 </listener>
銆銆FilterChainProxy浼氭寜欏哄簭鏉ヨ皟鐢ㄨ繖浜沠ilter,浣胯繖浜沠ilter鑳戒韓鐢⊿pring ioc鐨勫姛鑳? CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON瀹氫箟浜唘rl姣旇緝鍓嶅厛杞負灝忓啓錛?PATTERN_TYPE_APACHE_ANT瀹氫箟浜嗕嬌鐢ˋpache ant鐨勫尮閰嶆ā寮?
<bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy">
聽聽聽聽聽聽聽 <property name="filterInvocationDefinitionSource">
聽聽聽聽聽聽聽聽聽聽聽 <value>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 PATTERN_TYPE_APACHE_ANT
聽聽聽聽聽聽聽聽聽聽聽聽聽聽 /**=httpSessionContextIntegrationFilter,authenticationProcessingFilter,
basicProcessingFilter,rememberMeProcessingFilter,anonymousProcessingFilter,
exceptionTranslationFilter,filterInvocationInterceptor
聽聽聽聽聽聽聽聽聽聽聽 </value>
聽聽聽聽聽聽聽 </property>
聽聽聽 </bean>
1) authenticationManager
銆銆璧峰埌璁よ瘉綆$悊鐨勪綔鐢紝瀹冨皢楠岃瘉鐨勫姛鑳藉鎵樼粰澶氫釜Provider錛屽茍閫氳繃閬嶅巻Providers, 浠ヤ繚璇佽幏鍙栦笉鍚屾潵婧愮殑韜喚璁よ瘉錛岃嫢鏌愪釜Provider鑳芥垚鍔熺‘璁ゅ綋鍓嶇敤鎴風殑韜喚錛宎uthenticate()鏂規硶浼氳繑鍥炰竴涓畬鏁寸殑鍖呭惈鐢ㄦ埛鎺堟潈淇℃伅鐨凙uthentication瀵硅薄錛屽惁鍒欎細鎶涘嚭涓涓狝uthenticationException銆?br />Acegi鎻愪緵浜嗕笉鍚岀殑AuthenticationProvider鐨勫疄鐜?濡傦細
聽聽聽聽聽聽聽 DaoAuthenticationProvider 浠庢暟鎹簱涓鍙栫敤鎴蜂俊鎭獙璇佽韓浠?br />聽聽聽聽聽聽聽 AnonymousAuthenticationProvider 鍖垮悕鐢ㄦ埛韜喚璁よ瘉
聽聽聽聽聽聽聽 RememberMeAuthenticationProvider 宸插瓨cookie涓殑鐢ㄦ埛淇℃伅韜喚璁よ瘉
聽聽聽聽聽聽聽 AuthByAdapterProvider 浣跨敤瀹瑰櫒鐨勯傞厤鍣ㄩ獙璇佽韓浠?br />聽聽聽聽聽聽聽 CasAuthenticationProvider 鏍規嵁Yale涓績璁よ瘉鏈嶅姟楠岃瘉韜喚, 鐢ㄤ簬瀹炵幇鍗曠偣鐧婚檰
聽聽聽聽聽聽聽 JaasAuthenticationProvider 浠嶫ASS鐧婚檰閰嶇疆涓幏鍙栫敤鎴蜂俊鎭獙璇佽韓浠?br />聽聽聽聽聽聽聽 RemoteAuthenticationProvider 鏍規嵁榪滅▼鏈嶅姟楠岃瘉鐢ㄦ埛韜喚
聽聽聽聽聽聽聽 RunAsImplAuthenticationProvider 瀵硅韓浠藉凡琚鐞嗗櫒鏇挎崲鐨勭敤鎴瘋繘琛岄獙璇?br />聽聽聽聽聽聽聽 X509AuthenticationProvider 浠嶺509璁よ瘉涓幏鍙栫敤鎴蜂俊鎭獙璇佽韓浠?br />聽聽聽聽聽聽聽 TestingAuthenticationProvider 鍗曞厓嫻嬭瘯鏃朵嬌鐢?/p>
聽聽聽聽聽聽聽 姣忎釜璁よ瘉鑰呬細瀵硅嚜宸辨寚瀹氱殑璇佹槑淇℃伅榪涜璁よ瘉錛屽DaoAuthenticationProvider浠呭UsernamePasswordAuthenticationToken榪欎釜璇佹槑淇℃伅榪涜璁よ瘉銆?/p>
<bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager">
聽聽聽聽聽聽聽 <property name="providers">
聽聽聽聽聽聽聽聽聽聽聽 <list>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <ref local="daoAuthenticationProvider"/>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <ref local="anonymousAuthenticationProvider"/>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <ref local="rememberMeAuthenticationProvider"/>
聽聽聽聽聽聽聽聽聽聽聽 </list>
聽聽聽聽聽聽聽 </property>
</bean>
2) daoAuthenticationProvider
銆銆榪涜綆鍗曠殑鍩轟簬鏁版嵁搴撶殑韜喚楠岃瘉銆侱aoAuthenticationProvider鑾峰彇鏁版嵁搴撲腑鐨勮處鍙峰瘑鐮佸茍榪涜鍖歸厤錛岃嫢鎴愬姛鍒欏湪閫氳繃鐢ㄦ埛韜喚鐨勫悓鏃惰繑鍥炰竴涓寘鍚巿鏉冧俊鎭殑Authentication瀵硅薄錛屽惁鍒欒韓浠介獙璇佸け璐ワ紝鎶涘嚭涓涓狝uthenticatiionException銆?/p>
聽聽聽 <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
聽聽聽聽聽聽聽 <property name="userDetailsService" ref="jdbcDaoImpl"/>
聽聽聽聽聽聽聽 <property name="userCache" ref="userCache"/>
聽聽聽聽聽聽聽 <property name="passwordEncoder" ref="passwordEncoder"/>
聽聽 </bean>
3) passwordEncoder
銆銆浣跨敤鍔犲瘑鍣ㄥ鐢ㄦ埛杈撳叆鐨勬槑鏂囪繘琛屽姞瀵嗐侫cegi鎻愪緵浜嗕笁縐嶅姞瀵嗗櫒:
PlaintextPasswordEncoder鈥旈粯璁わ紝涓嶅姞瀵嗭紝榪斿洖鏄庢枃.
ShaPasswordEncoder鈥斿搱甯岀畻娉?SHA)鍔犲瘑
Md5PasswordEncoder鈥旀秷鎭憳瑕?MD5)鍔犲瘑
<bean id="passwordEncoder" class="org.acegisecurity.providers.encoding.Md5PasswordEncoder"/>
4) jdbcDaoImpl
銆銆鐢ㄤ簬鍦ㄦ暟鎹腑鑾峰彇鐢ㄦ埛淇℃伅銆?acegi鎻愪緵浜嗙敤鎴峰強鎺堟潈鐨勮〃緇撴瀯錛屼絾鏄偍涔熷彲浠ヨ嚜宸辨潵瀹炵幇銆傞氳繃usersByUsernameQuery榪欎釜SQL寰楀埌浣犵殑(鐢ㄦ埛ID,瀵嗙爜,鐘舵佷俊鎭?;閫氳繃authoritiesByUsernameQuery榪欎釜SQL寰楀埌浣犵殑(鐢ㄦ埛ID,鎺堟潈淇℃伅)
<bean id="jdbcDaoImpl" class="org.acegisecurity.userdetails.jdbc.JdbcDaoImpl">
聽聽聽聽聽聽聽 <property name="dataSource" ref="dataSource"/>
聽聽聽聽聽聽聽 <property name="usersByUsernameQuery">
聽聽聽聽聽聽聽聽聽聽聽 <value>select loginid,passwd,1 from users where loginid = ?</value>
聽聽聽聽聽聽聽 </property>
聽聽聽聽聽聽聽 <property name="authoritiesByUsernameQuery">
聽聽聽聽聽聽聽聽聽聽聽 <value>select u.loginid,p.name from users u,roles r,permissions p,user_role ur,role_permis rp where u.id=ur.user_id and r.id=ur.role_id and p.id=rp.permis_id and
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 r.id=rp.role_id and p.status='1' and u.loginid=?</value>
聽聽聽聽聽聽聽 </property>
</bean>
5) userCache銆&聽 resourceCache
銆銆緙撳瓨鐢ㄦ埛鍜岃祫婧愮浉瀵瑰簲鐨勬潈闄愪俊鎭傛瘡褰撹姹備竴涓彈淇濇姢璧勬簮鏃訛紝daoAuthenticationProvider灝變細琚皟鐢ㄤ互鑾峰彇鐢ㄦ埛鎺堟潈淇℃伅銆傚鏋滄瘡嬈¢兘浠庢暟鎹簱鑾峰彇鐨勮瘽錛岄偅浠d環寰堥珮錛屽浜庝笉甯告敼鍙樼殑鐢ㄦ埛鍜岃祫婧愪俊鎭潵璇達紝鏈濂芥槸鎶婄浉鍏蟲巿鏉冧俊鎭紦瀛樿搗鏉ャ?璇﹁ 2.6.3 璧勬簮鏉冮檺瀹氫箟鎵╁睍 )
userCache鎻愪緵浜嗕袱縐嶅疄鐜? NullUserCache鍜孍hCacheBasedUserCache, NullUserCache瀹為檯涓婂氨鏄笉榪涜浠諱綍緙撳瓨錛孍hCacheBasedUserCache鏄嬌鐢‥hcache鏉ュ疄鐜扮紦鍔熻兘銆?/p>
聽聽聽 <bean id="userCacheBackend" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
聽聽聽聽聽聽聽 <property name="cacheManager" ref="cacheManager"/>
聽聽聽聽聽聽聽 <property name="cacheName" value="userCache"/>
聽聽聽 </bean>
聽聽聽 <bean id="userCache" class="org.acegisecurity.providers.dao.cache.EhCacheBasedUserCache" autowire="byName">
聽聽聽聽聽聽聽 <property name="cache" ref="userCacheBackend"/>
聽聽聽 </bean>
聽聽聽 <bean id="resourceCacheBackend" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
聽聽聽聽聽聽聽 <property name="cacheManager" ref="cacheManager"/>
聽聽聽聽聽聽聽 <property name="cacheName" value="resourceCache"/>
聽聽聽 </bean>
聽聽聽 <bean id="resourceCache" class="org.springside.modules.security.service.acegi.cache.ResourceCache" autowire="byName">
聽聽聽聽聽聽聽 <property name="cache" ref="resourceCacheBackend"/>
聽聽聽 </bean>
6) basicProcessingFilter
銆銆鐢ㄤ簬澶勭悊HTTP澶寸殑璁よ瘉淇℃伅錛屽浠嶴pring榪滅▼鍗忚(濡侶essian鍜孊urlap)鎴栨櫘閫氱殑嫻忚鍣ㄥIE,Navigator鐨凥TTP澶翠腑鑾峰彇鐢ㄦ埛淇℃伅錛屽皢浠栦滑杞氦緇欓氳繃authenticationManager灞炴ц閰嶇殑璁よ瘉綆$悊鍣ㄣ傚鏋滆璇佹垚鍔燂紝浼氬皢涓涓狝uthentication瀵硅薄鏀懼埌浼氳瘽涓紝鍚﹀垯錛屽鏋滆璇佸け璐ワ紝浼氬皢鎺у埗杞氦緇欒璇佸叆鍙g偣(閫氳繃authenticationEntryPoint灞炴ц閰?
聽聽聽 <bean id="basicProcessingFilter" class="org.acegisecurity.ui.basicauth.BasicProcessingFilter">
聽聽聽聽聽聽聽 <property name="authenticationManager" ref="authenticationManager"/>
聽聽聽聽聽聽聽 <property name="authenticationEntryPoint" ref="basicProcessingFilterEntryPoint"/>
聽聽聽 </bean>
7) basicProcessingFilterEntryPoint
銆銆閫氳繃鍚戞祻瑙堝櫒鍙戦佷竴涓狧TTP401(鏈巿鏉?娑堟伅錛屾彁紺虹敤鎴風櫥褰曘?br />澶勭悊鍩轟簬HTTP鐨勬巿鏉冭繃紼嬶紝 鍦ㄥ綋楠岃瘉榪囩▼鍑虹幇寮傚父鍚庣殑"鍘誨悜"錛岄氬父瀹炵幇杞悜銆佸湪response閲屽姞鍏rror淇℃伅絳夊姛鑳姐?/p>
<bean id="basicProcessingFilterEntryPoint" class="org.acegisecurity.ui.basicauth.BasicProcessingFilterEntryPoint">
聽聽聽聽聽聽聽 <property name="realmName" value="SpringSide Realm"/>
</bean>
8) authenticationProcessingFilterEntryPoint
銆銆褰撴姏鍑篈ccessDeniedException鏃訛紝灝嗙敤鎴烽噸瀹氬悜鍒扮櫥褰曠晫闈€傚睘鎬oginFormUrl閰嶇疆浜嗕竴涓櫥褰曡〃鍗曠殑URL,褰撻渶瑕佺敤鎴風櫥褰曟椂錛宎uthenticationProcessingFilterEntryPoint浼氬皢鐢ㄦ埛閲嶅畾鍚戝埌璇RL
<bean id="authenticationProcessingFilterEntryPoint" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint">
聽聽聽聽聽聽聽 <property name="loginFormUrl">
聽聽聽聽聽聽聽聽聽聽聽 <value>/security/login.jsp</value>
聽聽聽聽聽聽聽 </property>
聽聽聽聽聽聽聽 <property name="forceHttps" value="false"/>
</bean>
1) httpSessionContextIntegrationFilter
銆銆姣忔request鍓?HttpSessionContextIntegrationFilter浠嶴ession涓幏鍙朅uthentication瀵硅薄錛屽湪request瀹屽悗, 鍙堟妸Authentication瀵硅薄淇濆瓨鍒癝ession涓緵涓嬫request浣跨敤,姝ilter蹇呴』鍏朵粬Acegi filter鍓嶄嬌鐢紝浣夸箣鑳借法瓚婂涓姹傘?/p>
<bean id="httpSessionContextIntegrationFilter" class="org.acegisecurity.context.HttpSessionContextIntegrationFilter"></bean>
聽聽聽 <bean id="httpRequestAccessDecisionManager" class="org.acegisecurity.vote.AffirmativeBased">
聽聽聽聽聽聽聽 <property name="allowIfAllAbstainDecisions" value="false"/>
聽聽聽聽聽聽聽 <property name="decisionVoters">
聽聽聽聽聽聽聽聽聽聽聽 <list>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <ref bean="roleVoter"/>
聽聽聽聽聽聽聽聽聽聽聽 </list>
聽聽聽聽聽聽聽 </property>
</bean>
2) httpRequestAccessDecisionManager
銆銆緇忚繃鎶曠エ鏈哄埗鏉ュ喅瀹氭槸鍚﹀彲浠ヨ闂煇涓璧勬簮(URL鎴栨柟娉?銆俛llowIfAllAbstainDecisions涓篺alse鏃跺鏋滄湁涓涓垨浠ヤ笂鐨刣ecisionVoters鎶曠エ閫氳繃,鍒欐巿鏉冮氳繃銆傚彲閫夌殑鍐崇瓥鏈哄埗鏈塁onsensusBased鍜孶nanimousBased
聽聽聽 <bean id="httpRequestAccessDecisionManager" class="org.acegisecurity.vote.AffirmativeBased">
聽聽聽聽聽聽聽 <property name="allowIfAllAbstainDecisions" value="false"/>
聽聽聽聽聽聽聽 <property name="decisionVoters">
聽聽聽聽聽聽聽聽聽聽聽 <list>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <ref bean="roleVoter"/>
聽聽聽聽聽聽聽聽聽聽聽 </list>
聽聽聽聽聽聽聽 </property>
聽聽聽 </bean>
3) roleVoter
聽銆銆蹇呴』鏄互rolePrefix璁懼畾鐨剉alue寮澶寸殑鏉冮檺鎵嶈兘榪涜鎶曠エ,濡侫UTH_ , ROLE_
聽聽聽 <bean id="roleVoter" class="org.acegisecurity.vote.RoleVoter">
聽聽聽聽聽聽聽 <property name="rolePrefix" value="AUTH_"/>
聽聽 </bean>
4錛?strong>exceptionTranslationFilter
銆銆寮傚父杞崲榪囨護鍣紝涓昏鏄鐞咥ccessDeniedException鍜孉uthenticationException錛屽皢緇欐瘡涓紓甯告壘鍒板悎閫傜殑"鍘誨悜"聽
聽聽 <bean id="exceptionTranslationFilter" class="org.acegisecurity.ui.ExceptionTranslationFilter">
聽聽聽聽聽聽聽 <property name="authenticationEntryPoint" ref="authenticationProcessingFilterEntryPoint"/>
聽聽聽 </bean>
5) authenticationProcessingFilter
銆銆鍜宻ervlet spec宸笉澶?澶勭悊鐧婚檰璇鋒眰.褰撹韓浠介獙璇佹垚鍔熸椂錛孉uthenticationProcessingFilter浼氬湪浼氳瘽涓斁緗竴涓狝uthentication瀵硅薄錛屽茍涓旈噸瀹氬悜鍒扮櫥褰曟垚鍔熼〉闈?br />聽聽聽聽聽聽聽聽 authenticationFailureUrl瀹氫箟鐧婚檰澶辮觸鏃惰漿鍚戠殑欏甸潰
聽聽聽聽聽聽聽聽 defaultTargetUrl瀹氫箟鐧婚檰鎴愬姛鏃惰漿鍚戠殑欏甸潰
聽聽聽聽聽聽聽聽 filterProcessesUrl瀹氫箟鐧婚檰璇鋒眰鐨勯〉闈?br />聽聽聽聽聽聽聽聽 rememberMeServices鐢ㄤ簬鍦ㄩ獙璇佹垚鍔熷悗娣誨姞cookie淇℃伅
聽聽聽 <bean id="authenticationProcessingFilter" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter">
聽聽聽聽聽聽聽 <property name="authenticationManager" ref="authenticationManager"/>
聽聽聽聽聽聽聽 <property name="authenticationFailureUrl">
聽聽聽聽聽聽聽聽聽聽聽 <value>/security/login.jsp?login_error=1</value>
聽聽聽聽聽聽聽 </property>
聽聽聽聽聽聽聽 <property name="defaultTargetUrl">
聽聽聽聽聽聽聽聽聽聽聽 <value>/admin/index.jsp</value>
聽聽聽聽聽聽聽 </property>
聽聽聽聽聽聽聽 <property name="filterProcessesUrl">
聽聽聽聽聽聽聽聽聽聽聽 <value>/j_acegi_security_check</value>
聽聽聽聽聽聽聽 </property>
聽聽聽聽聽聽聽 <property name="rememberMeServices" ref="rememberMeServices"/>
聽聽聽 </bean>
6) filterInvocationInterceptor
銆銆鍦ㄦ墽琛岃漿鍚憉rl鍓嶆鏌bjectDefinitionSource涓瀹氱殑鐢ㄦ埛鏉冮檺淇℃伅銆傞鍏堬紝objectDefinitionSource涓畾涔変簡璁塊棶URL闇瑕佺殑灞炴т俊鎭?榪欓噷鐨勫睘鎬т俊鎭粎浠呮槸鏍囧織錛屽憡璇塧ccessDecisionManager瑕佺敤鍝簺voter鏉ユ姇紲?銆傜劧鍚庯紝authenticationManager鎺夌敤鑷繁鐨刾rovider鏉ュ鐢ㄦ埛鐨勮璇佷俊鎭繘琛屾牎楠屻傛渶鍚庯紝鏈夋姇紲ㄨ呮牴鎹敤鎴鋒寔鏈夎璇佸拰璁塊棶url闇瑕佺殑灞炴э紝璋冪敤鑷繁鐨剉oter鏉ユ姇紲紝鍐沖畾鏄惁鍏佽璁塊棶銆?/p>
聽聽聽 <bean id="filterInvocationInterceptor" class="org.acegisecurity.intercept.web.FilterSecurityInterceptor">
聽聽聽聽聽聽聽 <property name="authenticationManager" ref="authenticationManager"/>
聽聽聽聽聽聽聽 <property name="accessDecisionManager" ref="httpRequestAccessDecisionManager"/>
聽聽聽聽聽聽聽 <property name="objectDefinitionSource" ref="filterDefinitionSource"/>
聽聽聽 </bean>
7) filterDefinitionSource (璇﹁ 2.6.3 璧勬簮鏉冮檺瀹氫箟鎵╁睍)
銆銆鑷畾涔塂BFilterInvocationDefinitionSource浠庢暟鎹簱鍜宑ache涓鍙栦繚鎶よ祫婧愬強鍏墮渶瑕佺殑璁塊棶鏉冮檺淇℃伅聽
<bean id="filterDefinitionSource" class="org.springside.modules.security.service.acegi.DBFilterInvocationDefinitionSource">
聽聽聽聽聽聽聽 <property name="convertUrlToLowercaseBeforeComparison" value="true"/>
聽聽聽聽聽聽聽 <property name="useAntPath" value="true"/>
聽聽聽聽聽聽聽 <property name="acegiCacheManager" ref="acegiCacheManager"/>
</bean>
(璇﹁ 2.6.3 璧勬簮鏉冮檺瀹氫箟鎵╁睍)
1) methodSecurityInterceptor
銆銆鍦ㄦ墽琛屾柟娉曞墠榪涜鎷︽埅錛屾鏌ョ敤鎴鋒潈闄愪俊鎭?br />2) methodDefinitionSource
銆銆鑷畾涔塎ethodDefinitionSource浠巆ache涓鍙栨潈闄?/p>
聽聽 <bean id="methodSecurityInterceptor" class="org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor">
聽聽聽聽聽聽聽 <property name="authenticationManager" ref="authenticationManager"/>
聽聽聽聽聽聽聽 <property name="accessDecisionManager" ref="httpRequestAccessDecisionManager"/>
聽聽聽聽聽聽聽 <property name="objectDefinitionSource" ref="methodDefinitionSource"/>
聽聽聽 </bean>
聽聽聽 <bean id="methodDefinitionSource" class="org.springside.modules.security.service.acegi.DBMethodDefinitionSource">
聽聽聽聽聽聽聽 <property name="acegiCacheManager" ref="acegiCacheManager"/>
聽聽聽 </bean>
閲囩敤 http://jcaptcha.sourceforge.net聽浣滀負閫氱敤鐨勯獙璇佺爜鏂規錛岃鍙傝僑pringSide涓殑渚嬪瓙錛屾垨緗戜笂鐨勶細
http://www.coachthrasher.com/page/blog?entry=jcaptcha_with_appfuse銆?/p>
宸矙鍦ㄦ榪囩▼涓張鍙戠幇acegi logout filter鐨勯敊璇紝榪涜浜嗕慨姝c?/p>
鍙﹀瀹冮粯璁ゆ彁渚涚殑鍥劇墖姣旇緝闅捐錛屾垜浠琧ustom浜嗕竴涓編瑙備竴鐐圭殑鐗堟湰銆?/p>
鏈琩emo鏃㈤傚悎浜嶫SF + Spring2.0.1 + Hibernate3.2 欏圭洰涔熼傚悎浜嶴truts + Spring2.0.1 + Hibernate3.2欏圭洰錛?br />
鏈垪鍏ョ壒鍒鏄庢病鏈夋巿鏉冪殑浼佷笟鍜屼釜浜洪兘鍙互鑷敱鍏嶈垂涓嬭澆浣跨敤鎻愪緵瀹濊吹鎰忚錛?br />
鏈漢涓嶆ュ姛榪戝埄錛屾鍦ㄥ仛瀹屾暣鐨勬枃妗g紪鍐欙紝鍋氭渶鍚庝弗鏍肩殑嫻嬭瘯錛岃繎鏈熷湪姝ゅ厤璐瑰彂甯冿紝鏁鍏蟲敞錛?/p>