File tree Expand file tree Collapse file tree
jetty-session-demo/src/main/java/com/baeldung/spring/session/jettyex
src/main/java/com/baeldung/spring/session/tomcatex Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
1313 @ Override
1414 protected void configure (HttpSecurity http ) throws Exception {
1515 http
16- .sessionManagement ().sessionCreationPolicy (SessionCreationPolicy .NEVER ).and ()
17- .authorizeRequests ().anyRequest ().hasRole ("ADMIN" );
16+ .sessionManagement ().sessionCreationPolicy (SessionCreationPolicy .NEVER ).and ()
17+ .authorizeRequests ().anyRequest ().hasRole ("ADMIN" );
1818 }
1919}
Original file line number Diff line number Diff line change 1919 <module >jetty-session-demo</module >
2020 <module >tomcat-session-demo</module >
2121 </modules >
22+
2223</project >
Original file line number Diff line number Diff line change 6666 <target >1.8</target >
6767 </configuration >
6868 </plugin >
69+ <plugin >
70+ <groupId >org.apache.maven.plugins</groupId >
71+ <artifactId >maven-surefire-plugin</artifactId >
72+ <version >${maven-surefire-plugin.version} </version >
73+ <configuration >
74+ <excludes >
75+ <exclude >**/*ControllerTest.java</exclude >
76+ </excludes >
77+ </configuration >
78+ </plugin >
6979 </plugins >
7080 </build >
81+
82+ <properties >
83+ <maven-surefire-plugin .version>2.19.1</maven-surefire-plugin .version>
84+ </properties >
7185</project >
Original file line number Diff line number Diff line change @@ -14,16 +14,16 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
1414 @ Autowired
1515 public void configureGlobal (AuthenticationManagerBuilder auth ) throws Exception {
1616 auth
17- .inMemoryAuthentication ()
18- .withUser ("admin" ).password ("password" ).roles ("ADMIN" );
17+ .inMemoryAuthentication ()
18+ .withUser ("admin" ).password ("password" ).roles ("ADMIN" );
1919 }
2020
2121 @ Override
2222 protected void configure (HttpSecurity http ) throws Exception {
2323 http
24- .httpBasic ().and ()
25- .authorizeRequests ()
26- .antMatchers ("/tomcat/admin" ).hasRole ("ADMIN" )
27- .anyRequest ().authenticated ();
24+ .httpBasic ().and ()
25+ .authorizeRequests ()
26+ .antMatchers ("/tomcat/admin" ).hasRole ("ADMIN" )
27+ .anyRequest ().authenticated ();
2828 }
2929}
You can’t perform that action at this time.
0 commit comments