I'm not sure but when you are trying to access a web which has an access restriction and you are not authenticated the FilterSecurityInterceptor throws and exception
org.springframework.security.intercept.AbstractSec urityInterceptor
beforeInvocation()
Code:
if (SecurityContextHolder.getContext().getAuthentication() == null) {
credentialsNotFound(messages.getMessage("AbstractSecurityInterceptor.authenticationNotFound",
"An Authentication object was not found in the SecurityContext"), object, attr);
}
...
private void credentialsNotFound(String reason, Object secureObject, ConfigAttributeDefinition configAttribs) {
AuthenticationCredentialsNotFoundException exception = new AuthenticationCredentialsNotFoundException(reason);
AuthenticationCredentialsNotFoundEvent event = new AuthenticationCredentialsNotFoundEvent(secureObject,
configAttribs, exception);
publishEvent(event);
throw exception;
}
So, if in the SecurityContext the authentication object does not exists (because the user is not authenticated yet) the credentialsNotFoundException is thrown and the FilterInterceptorSecurity does not continue. The next step is that the ExceptionTranslationFilter sends you to the entry point.
Please, correct me if I'm telling something wrong. I'm really new in Spring security but I've worked hard and debug alot to understand all XD
In conclusion, I think you problem is rare, maybe you have something that is not correctly configured :S