Is the right way to do this to implement the RedirectStrategy interface and create a SimpleUrlAuthenticationFailureHandler bean referencing it?
Code:
<beans:bean id="simpleUrlAuthenticationFailureHandler" class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler">
<beans:property name="redirectStrategy" ref="backToReferrer"/>
</beans:bean>
<beans:bean id="backToReferrer" class="com.example.RedirectStrategyBackToReferrer"/>
And then the class:
Code:
public class RedirectStrategyBackToReferrer implements RedirectStrategy {
public void sendRedirect(HttpServletRequest request, HttpServletResponse response, String url) {
response.sendRedirect(addParameterIndicatingFailedLogin(request.getHeader("Referer")));
}
}
Make sense? Was this the purpose of SimpleUrlAuthenticationFailureHandler and RedirectStrategy?