使用acegi在业务逻辑层获得Web层的用户ID

〈property name="authenticationManager" ref="authenticationManager"/〉
〈property name="authenticationFailureUrl" value="/index_acegi.jsp?login_error=1"/〉
〈property name="defaultTargetUrl" value="/testacegi.jsp"/〉
〈property name="filterProcessesUrl" value="/j_acegi_security_check"/〉
〈/bean〉

〈bean id="securityContextHolderAwareRequestFilter" class="org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter"/〉
〈bean id="exceptionTranslationFilter" class="org.acegisecurity.ui.ExceptionTranslationFilter"〉
〈property name="authenticationEntryPoint"〉
〈bean class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint"〉
〈property name="loginFormUrl" value="/acegilogin.jsp"/〉
〈property name="forceHttps" value="false"/〉
〈/bean〉
〈/property〉
〈property name="accessDeniedHandler"〉
〈bean class="org.acegisecurity.ui.AccessDeniedHandlerImpl"〉
〈property name="errorPage" value="/accessDenied.jsp"/〉
〈/bean〉
〈/property〉
〈/bean〉

〈bean id="filterInvocationInterceptor" class="org.acegisecurity.intercept.web.FilterSecurityInterceptor"〉
〈property name="authenticationManager" ref="authenticationManager"/〉
〈property name="accessDecisionManager"〉
〈bean class="org.acegisecurity.vote.AffirmativeBased"〉
〈property name="allowIfAllAbstainDecisions" value="false"/〉
〈property name="decisionVoters"〉
〈list〉
〈ref bean="roleVoter"/〉
〈bean class="org.acegisecurity.vote.AuthenticatedVoter"/〉
〈/list〉
〈/property〉
〈/bean〉
〈/property〉
〈property name="objectDefinitionSource"〉
〈value〉
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
/secure/extreme/**=AUTH_USER
/secure/**=IS_AUTHENTICATED_REMEMBERED
/**=IS_AUTHENTICATED_ANONYMOUSLY
〈/value〉
〈/property〉
〈/bean〉
〈bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager"〉
〈property name="providers"〉
〈list〉
〈ref local="daoAuthenticationProvider"/〉
〈ref local="anonymousAuthenticationProvider"/〉
〈/list〉
〈/property〉
〈/bean〉

〈bean id="anonymousProcessingFilter" class="org.acegisecurity.providers.anonymous.AnonymousProcessingFilter"〉
〈property name="key"〉〈value〉foobar〈/value〉〈/property〉
〈property name="userAttribute"〉〈value〉anonymousUser,AUTH_ANONYMOUS〈/value〉〈/property〉
〈/bean〉
〈bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"〉
〈property name="userDetailsService" ref="jdbcDaoImpl"/〉
〈property name="userCache"〉〈ref local="userCache"/〉〈/property〉
〈!-- if u want encode your password with md5,use property passwordEncoder,otherwise delete row below--〉
〈!--〈property name="passwordEncoder" ref="passwordEncoder"/〉--〉
〈/bean〉
〈bean id="passwordEncoder" class="org.acegisecurity.providers.encoding.Md5PasswordEncoder"/〉
〈bean id="loggerListener" class="org.acegisecurity.event.authentication.LoggerListener"/〉
〈!-- add --〉
〈bean id="jdbcDaoImpl" class="org.acegisecurity.userdetails.jdbc.JdbcDaoImpl"〉
〈property name="dataSource"〉〈ref bean= "dataSource"/〉〈/property〉
〈property name="usersByUsernameQuery"〉
〈!-- 〈value〉SELECT USERID, USERPASSWORD,IS_ENABLED FROM LTPMIUSER WHERE USERID=?〈/value〉 --〉

〈value〉SELECT USERNAME, PASSWORD,ENABLED FROM USERINFO WHERE USERNAME=?〈/value〉

〈/property〉
〈property name="authoritiesByUsernameQuery"〉
〈!--
〈value〉
SELECT userid,authority FROM ltpmiuser u, authorities a, user_auth ua
WHERE u.object_id=ua.user_oid
and a.auth_id=ua.auth_id
and u.userid = ?
〈/value〉
--〉

〈value〉
SELECT username,authority FROM userinfo u, authorities a, user_auth ua
WHERE u.user_id=ua.user_id
and a.auth_id=ua.auth_id
and u.username = ?
〈/value〉

〈/property〉

〈/bean〉

〈bean id="roleVoter" class="org.acegisecurity.vote.RoleVoter"〉
〈property name="rolePrefix"〉〈value〉AUTH_〈/value〉〈/property〉
〈/bean〉

〈bean id="anonymousAuthenticationProvider" class="org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider"〉
〈property name="key"〉〈value〉foobar〈/value〉〈/property〉
〈/bean〉


〈bean id="userCacheBackend" class="org.springframework.cache.ehcache.EhCacheFactoryBean"〉
〈property name="cacheManager"〉 〈ref local="cacheManager"/〉 〈/property〉
〈property name="cacheName"〉 〈value〉userCache〈/value〉 〈/property〉
〈/bean〉

〈bean id="userCache" class="org.acegisecurity.providers.dao.cache.EhCacheBasedUserCache"〉
〈property name="cache"〉〈ref local="userCacheBackend"/〉〈/property〉
〈/bean〉
〈bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"/〉


共6页 首页 上一页 [1] [2] [3] [4] [5下一页 尾页>
字母检索 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z