john017
May 4th, 2005, 08:49 AM
Is the AuthenticationManager called for every request.
My filters are configured as follows(as in sample) where httpSessionContextIntegrationfilter is called first.
<bean id="filterChainProxy" class="net.sf.acegisecurity.util.FilterChainProxy">
<property name="filterInvocationDefinitionSource">
<value>
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
/**=httpSessionContextIntegrationFilter,authenticat ionProcessingFilter,rememberMeProcessingFilter,ano nymousProcessingFilter,securityEnforcementFilter
</value>
</property>
</bean>
------------------------------------
AuthenticationProcessingFilter,RememberMe and Anonymous are called but note that user has not selected RememberMe.
So,now,code goes to SecurityEnforcementFilter which tries to authenticate
in beforeInvocation even though the authentication object was previously authenticated using LDAP or DB. Why should it go make a authenticationmanager.authenticate every request even if the contextholder contains the Authentication object with authentication set to true?
(Line 396)
Authentication authenticated;
try {
authenticated = this.authenticationManager.authenticate(context
.getAuthentication());
} catch (AuthenticationException authenticationException) {
AuthenticationFailureEvent event = new AuthenticationFailureEvent(object,
attr, context.getAuthentication(),
authenticationException);
this.context.publishEvent(event);
throw authenticationException;
}
Thanks ,
John
My filters are configured as follows(as in sample) where httpSessionContextIntegrationfilter is called first.
<bean id="filterChainProxy" class="net.sf.acegisecurity.util.FilterChainProxy">
<property name="filterInvocationDefinitionSource">
<value>
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
/**=httpSessionContextIntegrationFilter,authenticat ionProcessingFilter,rememberMeProcessingFilter,ano nymousProcessingFilter,securityEnforcementFilter
</value>
</property>
</bean>
------------------------------------
AuthenticationProcessingFilter,RememberMe and Anonymous are called but note that user has not selected RememberMe.
So,now,code goes to SecurityEnforcementFilter which tries to authenticate
in beforeInvocation even though the authentication object was previously authenticated using LDAP or DB. Why should it go make a authenticationmanager.authenticate every request even if the contextholder contains the Authentication object with authentication set to true?
(Line 396)
Authentication authenticated;
try {
authenticated = this.authenticationManager.authenticate(context
.getAuthentication());
} catch (AuthenticationException authenticationException) {
AuthenticationFailureEvent event = new AuthenticationFailureEvent(object,
attr, context.getAuthentication(),
authenticationException);
this.context.publishEvent(event);
throw authenticationException;
}
Thanks ,
John