Skip to content

Commit

Permalink
workaround fix for #116: disable spring boot error security filter
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-s committed May 30, 2022
1 parent 3e6f297 commit fa74ddc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/it/smartcommunitylab/aac/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -273,6 +275,20 @@ public void configure(HttpSecurity http) throws Exception {

}

/*
* BUG hotfix: disable error filter because it doesn't work with dummyrequests
* and/or multiple filter chains TODO remove when upstream fixes the issue
*
* https://github.com/spring-projects/spring-security/issues/11055#issuecomment-
* 1098061598
*
*/
@Bean
public static BeanFactoryPostProcessor removeErrorSecurityFilter() {
return beanFactory -> ((DefaultListableBeanFactory) beanFactory)
.removeBeanDefinition("errorPageSecurityInterceptor");
}

@Bean
public CompositeLogoutHandler logoutHandler() {
List<LogoutHandler> handlers = new ArrayList<>();
Expand Down

0 comments on commit fa74ddc

Please sign in to comment.