Skip to content

Commit

Permalink
update to spring-boot 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sephiroth-j committed Oct 1, 2023
1 parent 499569b commit d5cdb4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.0</version>
<version>3.1.4</version>
<relativePath/>
</parent>

Expand Down
11 changes: 6 additions & 5 deletions src/main/java/hello/config/WebSecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity;
import org.springframework.security.config.web.server.SecurityWebFiltersOrder;
import org.springframework.security.config.web.server.ServerHttpSecurity;
import org.springframework.security.config.web.server.ServerHttpSecurity.CsrfSpec;
import org.springframework.security.config.web.server.ServerHttpSecurity.HttpBasicSpec;
import org.springframework.security.core.userdetails.ReactiveUserDetailsService;
import org.springframework.security.ldap.DefaultLdapUsernameToDnMapper;
import org.springframework.security.ldap.DefaultSpringSecurityContextSource;
Expand All @@ -46,17 +48,16 @@ public class WebSecurityConfig
public SecurityWebFilterChain springSecurityFilterChain(final ServerHttpSecurity http, final AuthenticationWebFilter ltpa2AuthenticationWebFilter)
{
http
.csrf().disable()
.httpBasic().disable()
.authorizeExchange()
.csrf(CsrfSpec::disable)
.httpBasic(HttpBasicSpec::disable)
.authorizeExchange(authorize -> authorize
.pathMatchers(
"/",
"/home"
).permitAll()
.pathMatchers("/hello").hasRole("DEVELOPERS")
// all other require any authentication
.anyExchange().authenticated()
.and()
.anyExchange().authenticated())
// apply ltpa2 authentication filter
.addFilterAt(ltpa2AuthenticationWebFilter, SecurityWebFiltersOrder.AUTHENTICATION);
return http.build();
Expand Down

0 comments on commit d5cdb4c

Please sign in to comment.