Expected Behavior
Being able to set failureHandler and failureUrl in AbstractAuthenticationFilterConfigurer without resetting one of them.
Current Behavior
When setting failureHandler, the failureUrl will be reset on the configurer. Same when setting failureUrl, in that case the failureHandleris set to default.
Context We arte trying to accomplish something like this:
@Slf4j
private static class LoggingUrlFailureHandler extends SimpleUrlAuthenticationFailureHandler {
@Override
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException {
log.error("Error while authenticating.", exception);
super.onAuthenticationFailure(request, response, exception);
}
}
And then we like to use it here while keeping the default behaviour (which would be redirect to error page and display an error to the user).
.and()
.saml2Login(saml2 -> {
saml2.failureHandler(new LoggingUrlFailureHandler());
});
Or we misunderstood how to use those properties or we missed another option to log exceptions happening while authenticating.
Comment From: jgrandja
Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. We prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it).