private void registerDefaultAccessDeniedHandler(H http) { ExceptionHandlingConfigurer<H> exceptionHandling = http .getConfigurer(ExceptionHandlingConfigurer.class); if (exceptionHandling == null) { return; } exceptionHandling.defaultAccessDeniedHandlerFor( this.accessDeniedHandler, this.requestMatcher); }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .anyRequest().denyAll() .and() .exceptionHandling() .defaultAccessDeniedHandlerFor( this.teapotDeniedHandler, new AntPathRequestMatcher("/hello/**")); // @formatter:on } }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .anyRequest().denyAll() .and() .exceptionHandling() .defaultAccessDeniedHandlerFor( this.teapotDeniedHandler, new AntPathRequestMatcher("/hello/**")) .defaultAccessDeniedHandlerFor( new AccessDeniedHandlerImpl(), AnyRequestMatcher.INSTANCE); // @formatter:on } }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .anyRequest().denyAll() .and() .exceptionHandling() .defaultAccessDeniedHandlerFor(new AccessDeniedHandlerImpl(), request -> false) .and() .httpBasic() .and() .oauth2ResourceServer() .jwt(); // @formatter:on }
private void registerDefaultAccessDeniedHandler(H http) { ExceptionHandlingConfigurer<H> exceptionHandling = http .getConfigurer(ExceptionHandlingConfigurer.class); if (exceptionHandling == null) { return; } exceptionHandling.defaultAccessDeniedHandlerFor( this.accessDeniedHandler, this.requestMatcher); }
private void registerDefaultAccessDeniedHandler(H http) { ExceptionHandlingConfigurer<H> exceptionHandling = http .getConfigurer(ExceptionHandlingConfigurer.class); if (exceptionHandling == null) { return; } exceptionHandling.defaultAccessDeniedHandlerFor( this.accessDeniedHandler, this.requestMatcher); }