Hi friends,
I need to apply password encoding in our application using ShawPassword Encoder. I have to get the user login name convert to lower case and use it as salt.
Plz help me to configure in this regard.Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"> <value>WEB-INF/lib/jdbc.properties</value> </property> </bean> <bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy"> <property name="filterInvocationDefinitionSource"> <value> CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON PATTERN_TYPE_APACHE_ANT /**=ConcurrentSessionFilter,httpSessionContextIntegrationFilter,logoutFilter,authenticationProcessingFilter,securityContextHolderAwareRequestFilter,anonymousProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor </value> </property> </bean> <bean id="httpSessionContextIntegrationFilter" class="org.acegisecurity.context.HttpSessionContextIntegrationFilter" /> <bean id="logoutFilter" class="org.acegisecurity.ui.logout.LogoutFilter"> <constructor-arg value="/index.jsp" /> <constructor-arg> <list> <bean class="org.acegisecurity.ui.logout.SecurityContextLogoutHandler" /> </list> </constructor-arg> </bean> <bean id="authenticationProcessingFilter" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter"> <property name="authenticationManager" ref="authenticationManager" /> <property name="authenticationFailureUrl" value="/dcecontroller/loginAction?action=defaultUser" /> <!-- <property name="defaultTargetUrl" value="/acegilogin.jsp" />--> <property name="defaultTargetUrl" value="/dcecontroller/loginAction?action=registeredUser" /> <property name="filterProcessesUrl"><value>/dcecontroller/j_acegi_security_check</value></property> </bean> <bean id="securityContextHolderAwareRequestFilter" class="org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter" /> <bean id="anonymousProcessingFilter" class="org.acegisecurity.providers.anonymous.AnonymousProcessingFilter"> <property name="key" value="changeThis" /> <property name="userAttribute" value="anonymousUser,ROLE_ANONYMOUS" /> </bean> <bean id="exceptionTranslationFilter" class="org.acegisecurity.ui.ExceptionTranslationFilter"> <property name="authenticationEntryPoint"> <bean class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint"> <property name="loginFormUrl" value="/dcecontroller/loginAction?action=defaultUser" /> </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" ref="accessDecisionManager" /> <property name="objectDefinitionSource"> <value> CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON PATTERN_TYPE_APACHE_ANT /**defaultuser=IS_AUTHENTICATED_ANONYMOUSLY /**registereduser=ROLE_ADMIN /dcecontroller/regaction**=ROLE_ADMIN /dcecontroller/listviewaction**=ROLE_ADMIN /dcecontroller/linkviewaction**=ROLE_ADMIN /**=IS_AUTHENTICATED_ANONYMOUSLY </value> </property> </bean> <bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager"> <property name="providers"> <list> <ref local="daoAuthenticationProvider" /> </list> </property> <property name="sessionController"><ref bean="concurrentSessionController"/></property> </bean> <bean id="accessDecisionManager" class="org.acegisecurity.vote.AffirmativeBased"> <property name="allowIfAllAbstainDecisions" value="false" /> <property name="decisionVoters"> <list> <bean class="org.acegisecurity.vote.RoleVoter" /> <bean class="org.acegisecurity.vote.AuthenticatedVoter" /> </list> </property> </bean> <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"> <property name="userDetailsService" ref="jdbcDaoImpl" /> <!-- UserCache property will activate the cache, it is not mandatory but increases performance by cacheing the user details retrieved from user-base --> <property name="userCache" ref="userCache"/> </bean> <bean id="jdbcDaoImpl" class="org.acegisecurity.userdetails.jdbc.JdbcDaoImpl"> <property name="dataSource"> <ref local="dataSource"/> </property> <property name="usersByUsernameQuery"> <value> select LTRIM(RTRIM(LoginNAME)) as username, LTRIM(RTRIM(PASSWORD)), STATUS as ENABLED from DCE_USERS where LoginNAME=? </value> </property> <property name="authoritiesByUsernameQuery"> <value> select LOGINNAME as username, LTRIM(RTRIM(ROLENAME)) as authority from DCE_USERS, DCE_ROLES, USERNROLES where USERNROLES.USERID=DCE_USERS.USERID and USERNROLES.ROLEID=DCE_ROLES.ROLEID and DCE_USERS.LOGINNAME =? </value> </property> </bean> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName"> <value>${db.driverClassName}</value> </property> <property name="url"> <value>${db.url}</value> </property> <property name="username"> <value>${db.username}</value> </property> <property name="password"> <value>${db.password}</value> </property> </bean> <bean id="userCache" class="org.acegisecurity.providers.dao.cache.EhCacheBasedUserCache"> <property name="cache"> <bean class="org.springframework.cache.ehcache.EhCacheFactoryBean"> <property name="cacheManager"> <bean class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" /> </property> <property name="cacheName" value="userCache" /> </bean> </property> </bean> <!-- This bean is optional; it isn't used by any other bean as it only listens and logs --> <bean id="loggerListener" class="org.acegisecurity.event.authentication.LoggerListener" /> <!--Concurrent Session Handling --> <bean id="ConcurrentSessionFilter" class="org.acegisecurity.concurrent.ConcurrentSessionFilter"> <property name="sessionRegistry"> <ref local="sessionRegistry"/></property> <property name="expiredUrl" value="/accessDenied.jsp"/> </bean> <bean id="concurrentSessionController" class="org.acegisecurity.concurrent.ConcurrentSessionControllerImpl"> <property name="maximumSessions"><value>1</value></property> <!-- <property name="exceptionIfMaximumExceeded"><value>true</value></property>--> <property name="sessionRegistry"><ref local="sessionRegistry"/></property> </bean> <bean id="sessionRegistry" class="org.acegisecurity.concurrent.SessionRegistryImpl"/> <!--Concurrent Session Handling --> </beans>
If i need to implement Sha256 or Sha512 Encoding how to do in Acegi



