Custom Authenticator not firing...?!??!@?
"Griffith, Michael *" <[email protected]>
| Newsgroups | gmane.comp.java.springframework.user |
|---|---|
| Message-ID | <[email protected]> |
Hi everyone,
I'm trying to stub out a custom authenticator, which I will later get to
authenticate against Quest's Web SSO. I am using Acegi 1.0.7 and Spring
2.5.x It doesn't seem that the custom filter is doing its job and the
authentication mechanism always returns anonymous user because of the
anonymousProcessingFilter.
I have my filterProxy Chain defined as such:
<bean id="filterChainProxy"
class="org.acegisecurity.util.FilterChainProxy">
<property name="filterInvocationDefinitionSource">
<value>
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
/**=httpSessionContextIntegrationFilter,logoutFilter,mockAuthenticationF
ilter,securityContextHolderAwareRequestFilter,anonymousProcessingFilter,
exceptionTranslationFilter,filterInvocationInterceptor
</value>
</property>
</bean>
The rest of the authentication wiring looks like:
<bean id="authenticationManager"
class="org.acegisecurity.providers.ProviderManager">
<property name="providers">
<list>
<ref bean="mockAuthenticatorProvider"/>
</list>
</property>
</bean>
<bean id="mockAuthenticatorProvider"
class="...web.util.MockAuthenticatorProvider"/>
<bean id="mockAuthenticationFilter"
class="...web.filter.MockAuthenticationFilter">
<property name="authenticationManager"><ref
local="authenticationManager"/></property>
<property
name="authenticationFailureUrl"><value>/public/login.action?login_error=
1</value></property>
<property name="defaultTargetUrl"><value>/</value></property>
<property
name="filterProcessesUrl"><value>/j_acegi_mock_security_check</value></p
roperty>
</bean>
My filter looks as such:
public class MockAuthenticationFilter extends AbstractProcessingFilter {
private static final Log logger =
LogFactory.getLog(MockAuthenticationFilter.class);
@Override
public Authentication attemptAuthentication(HttpServletRequest
requests)
throws AuthenticationException {
logger.debug("**** in
MockAuthenticationFilter.attemptAuthentication");
Authentication authentication=
getAuthenticationManager().authenticate(null);
logger.debug("Returning Authentication: " +
authentication);
return authentication;
}
@Override
public String getDefaultFilterProcessesUrl() {
// TODO Auto-generated method stub
return "/j_acegi_mock_security_check";
}
}
What am I missing about this configuration?
The whole chain is supposed to return a MockAuthentication object with
my hard coded info for principle and granted authorities, but I never
see any of the debugging statements in the log. From the log info below,
it looks as if the filter is being referenced in the chain, but none of
the authentication mechanisms seems to be firing:
[Repository] DEBUG - FilterChainProxy$VirtualFilterChain.doFilter(270) |
/js/script.aculo.us/dragdrop.js at position 1 of 7 in additional filter
chain; firing Filter:
'org.acegisecurity.context.HttpSessionContextIntegrationFilter@b3869c'
[Repository] DEBUG - HttpSessionContextIntegrationFilter.doFilter(227) |
Obtained a valid SecurityContext from ACEGI_SECURITY_CONTEXT to
associate with SecurityContextHolder:
'org.acegisecurity.context.SecurityContextImpl@6faaf9b0: Authentication:
org.acegisecurity.provid
ers.anonymous.AnonymousAuthenticationToken@6faaf9b0: Username:
anonymousUser; Password: [PROTECTED]; Authenticated: true; Details:
org.acegisecurity.ui.WebAuthenticationDetails@ffff8868: RemoteIpAddress:
10.148.0.185; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'
[Repository] DEBUG - FilterChainProxy$VirtualFilterChain.doFilter(270) |
/js/script.aculo.us/dragdrop.js at position 2 of 7 in additional filter
chain; firing Filter: 'org.acegisecurity.ui.logout.LogoutFilter@192b987'
[Repository] DEBUG - FilterChainProxy$VirtualFilterChain.doFilter(270) |
/js/script.aculo.us/dragdrop.js at position 3 of 7 in additional filter
chain; firing Filter:
'gov.hhs.fda.ocio.fastar.repository.web.filter.MockAuthenticationFilter@
1d2625d'
[Repository] DEBUG - FilterChainProxy$VirtualFilterChain.doFilter(270) |
/js/script.aculo.us/dragdrop.js at position 4 of 7 in additional filter
chain; firing Filter:
'org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter@137d0
cf'
[Repository] DEBUG - SavedRequestAwareWrapper.<init>(107) | Wrapper not
replaced; SavedRequest was: null
[Repository] DEBUG - FilterChainProxy$VirtualFilterChain.doFilter(270) |
/js/script.aculo.us/dragdrop.js at position 5 of 7 in additional filter
chain; firing Filter:
'org.acegisecurity.providers.anonymous.AnonymousProcessingFilter@16dcbc9
'
[Repository] DEBUG - AnonymousProcessingFilter.doFilter(118) |
SecurityContextHolder not populated with anonymous token, as it already
contained:
'org.acegisecurity.providers.anonymous.AnonymousAuthenticationToken@6faa
f9b0: Username: anonymousUser; Password: [PROTECTED];
Authenticated: true; Details:
org.acegisecurity.ui.WebAuthenticationDetails@ffff8868: RemoteIpAddress:
10.148.0.185; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'
[Repository] DEBUG - FilterChainProxy$VirtualFilterChain.doFilter(270) |
/js/script.aculo.us/dragdrop.js at position 6 of 7 in additional filter
chain; firing Filter:
'org.acegisecurity.ui.ExceptionTranslationFilter@15e3974'
[STDOUT] [Repository] DEBUG -
FilterChainProxy$VirtualFilterChain.doFilter(270) |
/js/script.aculo.us/dragdrop.js at position 7 of 7 in additional filter
chain; firing Filter:
'org.acegisecurity.intercept.web.FilterSecurityInterceptor@10e0904'
Any reply would be appreciated.
Best Regards,
MG
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com