Managing to get to close to what I'm after with the configuration I've pasted below. I needed to include 2 http tags to enable the 2 different login pages (normal login and a re-authentication log-in), and I needed to add a custom decision manager for the secure pages (needing fullyAuthenticated access) that would throw an InsufficientAuthenticationException if the voter denied access but was a remember me user.
Code:
<http pattern="/secure*" use-expressions="true" access-decision-manager-ref="myDecisionManager">
<intercept-url pattern="/secure*" access="fullyAuthenticated"/>
<form-login login-page="/reauthenticate"
default-target-url="/secure"
authentication-failure-url="/reauthenticatefailed"
login-processing-url="/j_reauthenticate" />
</http>
<beans:bean class="test.decisionmanager.MyAccessDecisionManager" id="myDecisionManager">
<beans:property name="decisionVoters">
<beans:list>
<beans:ref bean="webExpressionVoter"/>
</beans:list>
</beans:property>
</beans:bean>
<beans:bean class="org.springframework.security.web.access.expression.WebExpressionVoter" id="webExpressionVoter"/>
<http use-expressions="true">
<intercept-url pattern="/login*" access="permitAll"/>
<intercept-url pattern="/logout*" access="authenticated"/>
<intercept-url pattern="/profile*" access="authenticated"/>
<intercept-url pattern="/*"/>
<form-login login-page="/login" default-target-url="/profile" authentication-failure-url="/loginfailed" />
<logout invalidate-session="true" logout-url="/logout" logout-success-url="/loggedout" />
</http>
<authentication-manager> ....
The MyDecisionManager is identical to the default AffirmativeBased except for the chunk of code below. It means that the InsufficientAuthenticationException is thrown and thus the ExceptionTranslationFilter will store the request and re-direct to the re-authenticate login without any changes;
Code:
if (deny > 0) {
// CHANGED HERE - ADDED isRememberMe CHECK AND NEW EXCEPTION
if (authenticationTrustResolver.isRememberMe(authentication)) {
throw new InsufficientAuthenticationException("Full authentication is required to access this resource");
} else {
throw new AccessDeniedException(messages.getMessage("AbstractAccessDecisionManager.accessDenied",
"Access is denied"));
}
}