title: Spring Boot: accessDeniedHandler does not work
body: <p>I've got the following Spring Security configuration:</p>
  
  <pre><code>@Configuration
  @EnableWebSecurity
  public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
  
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          http.authorizeRequests().antMatchers("/api/private/**", "/app/**").authenticated();
          http.csrf().disable();
          http.logout().logoutSuccessUrl("/");
          http.exceptionHandling().accessDeniedPage("/403"); //.accessDeniedHandler(accessDeniedHandler);
      }
  }
  </code></pre>
  
  <p>I expect the following logic: not authenticated users will be redirected to <code>/403</code>. Instead of that Spring displays a default Tomcat 403 page. I also tried custom <code>accessDeniedHandler</code> withough any success.</p>
  
  <p>How can I implement custom logic on access failure?</p>