Problem with Acegi and HTTPS

I use spring framework acegi-security-0.9.0 vesrion and tomcat 5.5. I want use HTTPS for login page. my acegi configuration file contains following code :

<bean id="rootChainProxy" class="net.sf.acegisecurity.util.FilterChainProxy">

<property name="filterInvocationDefinitionSource">

<value>

CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON

PATTERN_TYPE_APACHE_ANT

/**=httpSessionContextIntegrationFilter,authenticationProcessingFilter,basicProcessingFilter,rememberMeProcessingFilter,securityEnforcementFilter

</value>

</property>

</bean>

////////////////

<bean id="authenticationProcessingFilterEntryPoint" class="net.sf.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint">

<property name="loginFormUrl"><value>/jsp/index.faces</value>

</property>

<property name="forceHttps"><value>true</value></property></bean>

but it doesn't work , without eny exception.

maybe it needs some configuration ?

Can Anyone help me?

[1147 byte] By [tamria] at [2007-11-27 8:43:13]
# 1

I write code of xml configuration file to be more clear:

<?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="rootChainProxy" class="net.sf.acegisecurity.util.FilterChainProxy" >

<property name="filterInvocationDefinitionSource">

<value>

CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON

PATTERN_TYPE_APACHE_ANT

/**=httpSessionContextIntegrationFilter,authenticat ionProcessingFilter,basicProcessingFilter,remember MeProcessingFilter,securityEnforcementFilter

</value>

</property>

</bean>

<bean id="authenticationManager" class="net.sf.acegisecurity.providers.ProviderMana ger">

<property name="providers">

<list>

<ref local="daoAuthenticationProvider"/>

<ref local="rememberMeAuthenticationProvider"/>

</list>

</property>

<property name="sessionController"><ref bean="concurrentSessionController"/></property>

</bean>

<bean id="concurrentSessionController"

class="net.sf.acegisecurity.concurrent.ConcurrentS essionControllerImpl">

<property name="maximumSessions"><value>1</value></property>

<property name="sessionRegistry"><ref local="sessionRegistry"/></property>

</bean>

<bean id="sessionRegistry" class="net.sf.acegisecurity.concurrent.SessionRegi stryImpl"/>

<bean id="userAuthenticator" class="com.uedc.common.UserAuthenticationImpl">

<property name="userDAO">

<ref bean="userDAO"/>

</property>

</bean>

<bean id="plainPasswordEncoder" class="net.sf.acegisecurity.providers.encoding.Pla intextPasswordEncoder"/>

<bean id="hashPasswordEncoder" class="net.sf.acegisecurity.providers.encoding.Sha PasswordEncoder"/>

<bean id="daoAuthenticationProvider" class="net.sf.acegisecurity.providers.dao.DaoAuthe nticationProvider">

<property name="authenticationDao"><ref local="userAuthenticator"/></property>

<property name="passwordEncoder"><ref local="hashPasswordEncoder"/></property>

<property name="userCache"><ref local="userCache"/></property>

</bean>

<!-- User cache setetup -->

<bean id="userCacheManager" class="org.springframework.cache.ehcache.EhCacheMa nagerFactoryBean"/>

<bean id="userCacheBackend" class="org.springframework.cache.ehcache.EhCacheFa ctoryBean">

<property name="cacheManager">

<ref local="userCacheManager"/>

</property>

<property name="cacheName">

<value>userCache</value>

</property>

</bean>

<bean id="userCache" class="net.sf.acegisecurity.providers.dao.cache.Eh CacheBasedUserCache">

<property name="cache"><ref local="userCacheBackend"/></property>

</bean>

<bean id="loggerListener" class="net.sf.acegisecurity.event.authentication.L oggerListener"/>

<bean id="basicProcessingFilter" class="net.sf.acegisecurity.ui.basicauth.BasicProc essingFilter">

<property name="authenticationManager"><ref local="authenticationManager"/></property>

<property name="authenticationEntryPoint"><ref local="basicProcessingFilterEntryPoint"/></property>

</bean>

<bean id="basicProcessingFilterEntryPoint" class="net.sf.acegisecurity.ui.basicauth.BasicProc essingFilterEntryPoint">

<property name="realmName"><value>Contacts Realm</value></property>

</bean>

<!-- HTTP security -->

<bean id="httpSessionContextIntegrationFilter"

class="net.sf.acegisecurity.context.HttpSessionCon textIntegrationFilter">

<property name="context"><value>net.sf.acegisecurity.context .SecurityContextImpl</value></property>

</bean>

<bean id="rememberMeProcessingFilter" class="net.sf.acegisecurity.ui.rememberme.Remember MeProcessingFilter">

<property name="rememberMeServices"><ref local="rememberMeServices"/></property>

</bean>

<bean id="rememberMeServices" class="net.sf.acegisecurity.ui.rememberme.TokenBas edRememberMeServices">

<property name="authenticationDao"><ref local="userAuthenticator"/></property>

<property name="key"><value>springRocks</value></property>

</bean>

<bean id="rememberMeAuthenticationProvider" class="net.sf.acegisecurity.providers.rememberme.R ememberMeAuthenticationProvider">

<property name="key"><value>springRocks</value></property>

</bean>

<bean id="channelProcessingFilter" class="net.sf.acegisecurity.securechannel.ChannelP rocessingFilter">

<property name="channelDecisionManager"><ref local="channelDecisionManager"/></property>

<property name="filterInvocationDefinitionSource">

<value>

CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON

\A/secure/.*\Z=REQUIRES_SECURE_CHANNEL

\A/jsp/security/staffLogin.jsp.*\Z=REQUIRES_SECURE_CHANNEL

\A/jsp/security/staffLogin.faces.*\Z=REQUIRES_SECURE_CHANNEL

\A/jsp/security/j_acegi_security_check.*\Z=REQUIRES_SECURE_CHANNEL

\A.*\Z=REQUIRES_INSECURE_CHANNEL

</value>

</property>

</bean>

<bean id="channelDecisionManager" class="net.sf.acegisecurity.securechannel.ChannelD ecisionManagerImpl">

<property name="channelProcessors">

<list>

<ref local="secureChannelProcessor"/>

<ref local="insecureChannelProcessor"/>

</list>

</property>

</bean>

<bean id="secureChannelProcessor" class="net.sf.acegisecurity.securechannel.SecureCh annelProcessor"/>

<bean id="insecureChannelProcessor" class="net.sf.acegisecurity.securechannel.Insecure ChannelProcessor"/>

<bean id="authenticationProcessingFilter" class="net.sf.acegisecurity.ui.webapp.Authenticati onProcessingFilter">

<property name="authenticationManager"><ref bean="authenticationManager"/></property>

<property name="authenticationFailureUrl"><value>/jsp/security/staffLogin.faces?login_error=1</value></property>

<property name="defaultTargetUrl"><value>/jsp/staffMainmap.faces</value></property>

<property name="filterProcessesUrl"><value>/jsp/security/j_acegi_security_check</value></property>

<property name="rememberMeServices"><ref local="rememberMeServices"/></property>

</bean>

<bean id="authenticationProcessingFilterEntryPoint" class="net.sf.acegisecurity.ui.webapp.Authenticati onProcessingFilterEntryPoint">

<property name="loginFormUrl"><value>/jsp/security/staffLogin.faces</value></property>

<property name="forceHttps"><value>true</value></property>

</bean>

<bean id="httpRequestAccessDecisionManager" class="net.sf.acegisecurity.vote.AffirmativeBased" >

<property name="allowIfAllAbstainDecisions"><value>false</value></property>

<property name="decisionVoters">

<list>

<ref bean="roleVoter"/>

</list>

</property>

</bean>

<bean id="roleVoter" class="net.sf.acegisecurity.vote.RoleVoter"/>

<bean id="securityEnforcementFilter" class="net.sf.acegisecurity.intercept.web.Security EnforcementFilter">

<property name="filterSecurityInterceptor"><ref local="filterInvocationInterceptor"/></property>

<property name="authenticationEntryPoint"><ref local="authenticationProcessingFilterEntryPoint"/></property>

</bean>

<bean id="filterInvocationInterceptor" class="net.sf.acegisecurity.intercept.web.FilterSe curityInterceptor">

<property name="authenticationManager"><ref bean="authenticationManager"/></property>

<property name="accessDecisionManager"><ref local="httpRequestAccessDecisionManager"/></property>

<property name="objectDefinitionSource">

<value>

PATTERN_TYPE_APACHE_ANT

/jsp/index.jsp=ROLE_CRM_ADMIN,ROLE_CRM_MANAGER,ROLE_CRM _SERVICE_CLERK,ROLE_CRM_GUEST

/jsp/staffMainmap.*=ROLE_CRM_ADMIN,ROLE_CRM_MANAGER,ROL E_CRM_SERVICE_CLERK,ROLE_CRM_GUEST

/*=ROLE_CRM_ADMIN,ROLE_CRM_MANAGER,ROLE_CRM_SERVICE _CLERK,ROLE_CRM_GUEST

/=ROLE_CRM_ADMIN,ROLE_CRM_MANAGER,ROLE_CRM_SERVICE_ CLERK,ROLE_CRM_GUEST

</value>

</property>

</bean>

</beans>

and web.xml file

<filter>

<filter-name>rootSecurity</filter-name>

<filter-class>net.sf.acegisecurity.util.FilterToBeanProxy</filter-class>

<init-param>

<param-name>targetBean</param-name>

<param-value>channelProcessingFilter</param-value>

</init-param>

</filter>

<filter-mapping>

<filter-name>rootSecurity</filter-name>

<url-pattern>/*</url-pattern>

</filter-mapping>

It works , shows login page ,but when I login with username and password it doesn't go into userDao class for authentification.

Why doesn't do authentification ?What is wrong?

enyone can help me?

tamria at 2007-7-12 20:42:47 > top of Java-index,Security,Other Security APIs, Tools, and Issues...