This repository was archived by the owner on May 31, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
spring-boot-sample-secure-oauth2-resource/src/main/java/sample
spring-boot-sample-secure-oauth2-resource-jwt/src/main/java/sample Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 16
16
17
17
package sample ;
18
18
19
+ import org .springframework .beans .factory .config .BeanFactoryPostProcessor ;
20
+ import org .springframework .beans .factory .support .DefaultListableBeanFactory ;
19
21
import org .springframework .boot .SpringApplication ;
20
22
import org .springframework .boot .autoconfigure .SpringBootApplication ;
23
+ import org .springframework .context .annotation .Bean ;
21
24
import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
22
25
import org .springframework .security .oauth2 .config .annotation .web .configuration .EnableResourceServer ;
23
26
import org .springframework .security .oauth2 .config .annotation .web .configuration .ResourceServerConfigurerAdapter ;
@@ -38,6 +41,13 @@ public void configure(HttpSecurity http) throws Exception {
38
41
// @formatter:on
39
42
}
40
43
44
+ // https://github.com/spring-projects/spring-boot/issues/28759#issuecomment-975408187
45
+ @ Bean
46
+ static BeanFactoryPostProcessor removeErrorSecurityFilter () {
47
+ return (beanFactory ) -> ((DefaultListableBeanFactory ) beanFactory )
48
+ .removeBeanDefinition ("errorPageSecurityInterceptor" );
49
+ }
50
+
41
51
public static void main (String [] args ) {
42
52
SpringApplication .run (SampleSecureOAuth2ResourceApplication .class , args );
43
53
}
Original file line number Diff line number Diff line change 16
16
17
17
package sample ;
18
18
19
+ import org .springframework .beans .factory .config .BeanFactoryPostProcessor ;
20
+ import org .springframework .beans .factory .support .DefaultListableBeanFactory ;
19
21
import org .springframework .boot .SpringApplication ;
20
22
import org .springframework .boot .autoconfigure .SpringBootApplication ;
23
+ import org .springframework .context .annotation .Bean ;
21
24
import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
22
25
import org .springframework .security .oauth2 .config .annotation .web .configuration .EnableResourceServer ;
23
26
import org .springframework .security .oauth2 .config .annotation .web .configuration .ResourceServerConfigurerAdapter ;
@@ -38,6 +41,13 @@ public void configure(HttpSecurity http) throws Exception {
38
41
// @formatter:on
39
42
}
40
43
44
+ // https://github.com/spring-projects/spring-boot/issues/28759#issuecomment-975408187
45
+ @ Bean
46
+ static BeanFactoryPostProcessor removeErrorSecurityFilter () {
47
+ return (beanFactory ) -> ((DefaultListableBeanFactory ) beanFactory )
48
+ .removeBeanDefinition ("errorPageSecurityInterceptor" );
49
+ }
50
+
41
51
public static void main (String [] args ) {
42
52
SpringApplication .run (SampleSecureOAuth2ResourceApplication .class , args );
43
53
}
You can’t perform that action at this time.
0 commit comments