File tree Expand file tree Collapse file tree
patterns/intercepting-filter
spring-security-sso-ui-2/src/main/java/org/baeldung/config
spring-security-sso-ui/src/main/java/org/baeldung/config
spring-zuul/spring-zuul-ui/src/main/java/org/baeldung/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 <groupId >org.slf4j</groupId >
2323 <artifactId >slf4j-api</artifactId >
2424 <version >${slf4j.version} </version >
25- <scope >provided</scope >
2625 </dependency >
2726 </dependencies >
2827
Original file line number Diff line number Diff line change 33import org .springframework .boot .SpringApplication ;
44import org .springframework .boot .autoconfigure .SpringBootApplication ;
55import org .springframework .boot .autoconfigure .security .oauth2 .client .EnableOAuth2Sso ;
6+ import org .springframework .boot .web .support .SpringBootServletInitializer ;
67import org .springframework .context .annotation .Bean ;
7- import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
8- import org .springframework .security .config .annotation .web .configuration .WebSecurityConfigurerAdapter ;
98import org .springframework .web .context .request .RequestContextListener ;
109
1110@ EnableOAuth2Sso
1211@ SpringBootApplication
13- public class UiApplication extends WebSecurityConfigurerAdapter {
12+ public class UiApplication extends SpringBootServletInitializer {
1413
15- @ Override
16- public void configure (HttpSecurity http ) throws Exception {
17- http .antMatcher ("/**" )
18- .authorizeRequests ()
19- .antMatchers ("/" , "/login**" )
20- .permitAll ()
21- .anyRequest ()
22- .authenticated ();
23- }
2414
2515 @ Bean
2616 public RequestContextListener requestContextListener () {
Original file line number Diff line number Diff line change 1+ package org .baeldung .config ;
2+
3+ import org .springframework .context .annotation .Configuration ;
4+ import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
5+ import org .springframework .security .config .annotation .web .configuration .WebSecurityConfigurerAdapter ;
6+
7+ @ Configuration
8+ public class UiSecurityConfig extends WebSecurityConfigurerAdapter {
9+
10+ @ Override
11+ public void configure (HttpSecurity http ) throws Exception {
12+ http .antMatcher ("/**" )
13+ .authorizeRequests ()
14+ .antMatchers ("/" , "/login**" )
15+ .permitAll ()
16+ .anyRequest ()
17+ .authenticated ();
18+ }
19+
20+ }
Original file line number Diff line number Diff line change 33import org .springframework .boot .SpringApplication ;
44import org .springframework .boot .autoconfigure .SpringBootApplication ;
55import org .springframework .boot .autoconfigure .security .oauth2 .client .EnableOAuth2Sso ;
6+ import org .springframework .boot .web .support .SpringBootServletInitializer ;
67import org .springframework .context .annotation .Bean ;
7- import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
8- import org .springframework .security .config .annotation .web .configuration .WebSecurityConfigurerAdapter ;
98import org .springframework .web .context .request .RequestContextListener ;
109
1110@ EnableOAuth2Sso
1211@ SpringBootApplication
13- public class UiApplication extends WebSecurityConfigurerAdapter {
14-
15- @ Override
16- public void configure (HttpSecurity http ) throws Exception {
17- http .antMatcher ("/**" )
18- .authorizeRequests ()
19- .antMatchers ("/" , "/login**" )
20- .permitAll ()
21- .anyRequest ()
22- .authenticated ();
23- }
12+ public class UiApplication extends SpringBootServletInitializer {
2413
2514 @ Bean
2615 public RequestContextListener requestContextListener () {
Original file line number Diff line number Diff line change 1+ package org .baeldung .config ;
2+
3+ import org .springframework .context .annotation .Configuration ;
4+ import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
5+ import org .springframework .security .config .annotation .web .configuration .WebSecurityConfigurerAdapter ;
6+
7+ @ Configuration
8+ public class UiSecurityConfig extends WebSecurityConfigurerAdapter {
9+
10+ @ Override
11+ public void configure (HttpSecurity http ) throws Exception {
12+ http .antMatcher ("/**" )
13+ .authorizeRequests ()
14+ .antMatchers ("/" , "/login**" )
15+ .permitAll ()
16+ .anyRequest ()
17+ .authenticated ();
18+ }
19+
20+ }
Original file line number Diff line number Diff line change 22
33import org .springframework .boot .SpringApplication ;
44import org .springframework .boot .autoconfigure .SpringBootApplication ;
5+ import org .springframework .boot .web .support .SpringBootServletInitializer ;
56import org .springframework .cloud .netflix .zuul .EnableZuulProxy ;
67
78@ EnableZuulProxy
89@ SpringBootApplication
9- public class UiApplication {
10+ public class UiApplication extends SpringBootServletInitializer {
1011
1112 public static void main (String [] args ) {
1213 SpringApplication .run (UiApplication .class , args );
You can’t perform that action at this time.
0 commit comments