File tree Expand file tree Collapse file tree
session-handling-spring-security
java/de/dominikschadow/javasecurity/sessionhandling/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 <packaging >jar</packaging >
1313 <name >Session Handling - Spring Security</name >
1414
15- <description >Session Handling with Spring Security sample project. Requires a system property (or environment
16- variable or command line argument) named jasypt.encryptor.password with the value
17- session-handling-spring-security present on startup. Start via the main method in the Application class. After
18- launching, open the web application in your browser at http://localhost:8080.
15+ <description >Session Handling with Spring Security sample project. Start via the main method in the Application
16+ class. After launching, open the web application in your browser at http://localhost:8080.
1917 </description >
2018
2119 <properties >
3533 <groupId >org.springframework.boot</groupId >
3634 <artifactId >spring-boot-starter-data-jpa</artifactId >
3735 </dependency >
36+ <!--
3837 <dependency>
3938 <groupId>com.github.ulisesbocchio</groupId>
4039 <artifactId>jasypt-spring-boot-starter</artifactId>
4140 </dependency>
41+ -->
4242 <dependency >
4343 <groupId >org.webjars</groupId >
4444 <artifactId >bootstrap</artifactId >
Original file line number Diff line number Diff line change @@ -53,13 +53,19 @@ protected void configure(HttpSecurity http) throws Exception {
5353 // @formatter:off
5454 http
5555 .authorizeRequests ()
56- .antMatchers ("/*" ).permitAll ()
56+ .antMatchers ("/*" , "/h2-console/**" ).permitAll ()
5757 .antMatchers ("/user/**" ).hasAnyRole ("USER" , "ADMIN" )
5858 .antMatchers ("/admin/**" ).hasRole ("ADMIN" )
59- .and ()
60- .formLogin ()
61- .and ()
62- .logout ()
59+ .and ()
60+ .csrf ()
61+ .ignoringAntMatchers ("/h2-console/*" )
62+ .and ()
63+ .headers ()
64+ .frameOptions ().sameOrigin ()
65+ .and ()
66+ .formLogin ()
67+ .and ()
68+ .logout ()
6369 .logoutSuccessUrl ("/" )
6470 .permitAll ();
6571 // @formatter:on
Original file line number Diff line number Diff line change 11spring :
22 datasource :
3- username : ses-han-spr-sec-admin
4- password : ENC(9bjqRQFmO73Gj6gh+XVv3qv7IE7iBs76UGi8bWKLQyH4CoE+w6kUgg==)
3+ username : admin
4+ password : samplePassword
5+ name : session-handling
6+ h2 :
7+ console :
8+ enabled : true
You can’t perform that action at this time.
0 commit comments