Summary

ExceptionTranslationFilter.handleSpringSecurityException is swallowing AccessDeniedException when authentication object is anonymous.

Maybe this is as designed, but I trying to capture that exception in my AuthenticationEntryPoint to i18ned it, but I only got InsufficientAuthenticationException with message "Full authentication is required to access this resource".

Should ExceptionTranslationFilter be MessageSourceAware? I can create another issue if yes.

Actual Behavior

Expected Behavior

I will let to you guys to decide the best solution. :)

Configuration

Spring boot default with custom AuthenticationEntryPoint.

Version

spring-security-4.2.3-RELEASE via spring-boot-1.5.7.RELEASE

Sample

I can create one if needed.

Comment From: diogosantana

Test case: https://github.com/diogosantana/spring-security-test-4630

Comment From: rwinch

Thanks for the report. This is a duplicate gh-8951 which has been fixed.