upgrading 0.8.0 Null authentication SecureContextImpl
I am trying to migrate from Acegi 0.7.0 to 0.8.0 and have come up against a problem with obtaining authentication details.
I believe the root of the problem lies with the context, in the session is:-
ACEGI_SECURITY_CONTEXT net.sf.acegisecurity.context.security.SecureContex tImpl@5a74a7: Null authentication
i.e. the authentication is Null
Therefore:
SecureContext secureContext = (SecureContext)ContextHolder.getContext();
Authentication auth = secureContext.getAuthentication();
will always return null for auth.
The logger returns:
[net.sf.acegisecurity.providers.dao.event.LoggerLis tener] - <Authentication success for user: wally; details: 127.0.0.1>
and in the session I get:
ACEGI_SECURITY_AUTHENTICATION net.sf.acegisecurity.providers.UsernamePasswordAut henticationToken@c58002: Username: com.somedomain.security.UserDet@572717; Password: [PROTECTED]; Authenticated: false; Details: 127.0.0.1; Granted Authorities: ROLE_USER
ACEGI_SECURITY_LAST_USERNAME wally
Thus indicating that the user is logged in.
I am only using httpSessionContextIntegrationFilter and authenticationProcessingFilter since all authorization is done (rightly or wrongly) with the front end (Tapestry).
Any ideas would be gratefully received.
Some relevant config:
<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
</value>
</property>
</bean>
<bean id="httpSessionContextIntegrationFilter" class="net.sf.acegisecurity.context.HttpSessionCon textIntegrationFilter">
<property name="context"><value>net.sf.acegisecurity.context .security.SecureContextImpl</value></property>
</bean>
Re: upgrading 0.8.0 Null authentication SecureContextImpl
Quote:
Originally Posted by pg
<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
</value>
</property>
</bean>
That looks fine. Could you please post a full DEBUG log of an attempt to authenticate, from the original redirection to the login page through to where the j_acegi_security_check processes the request.