JAVA-29303 Upgrade spring-security-web-angular (#15853)
* JAVA-29303 Upgrade spring-security-web-angular * JAVA-29303 Fix indentation --------- Co-authored-by: timis1 <noreplay@yahoo.com>
This commit is contained in:
parent
7cbf2eafcd
commit
d658a3d2b8
|
@ -10,7 +10,8 @@
|
|||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>spring-security-modules</artifactId>
|
||||
<artifactId>parent-boot-3</artifactId>
|
||||
<relativePath>../../parent-boot-3</relativePath>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -15,10 +15,6 @@
|
|||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<!--<dependency> -->
|
||||
<!--<groupId>org.springframework.boot</groupId> -->
|
||||
<!--<artifactId>spring-boot-starter-actuator</artifactId> -->
|
||||
<!--</dependency> -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.springframework.context.annotation.Configuration;
|
|||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
|
||||
|
@ -27,18 +28,13 @@ public class BasicAuthConfiguration {
|
|||
|
||||
@Bean
|
||||
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
http.csrf()
|
||||
.disable()
|
||||
http.csrf(AbstractHttpConfigurer::disable)
|
||||
.cors(withDefaults())
|
||||
.authorizeRequests()
|
||||
.antMatchers(HttpMethod.OPTIONS, "/**")
|
||||
.permitAll()
|
||||
.antMatchers("/login")
|
||||
.permitAll()
|
||||
.anyRequest()
|
||||
.authenticated()
|
||||
.and()
|
||||
.httpBasic();
|
||||
.authorizeHttpRequests(authorizationManagerRequestMatcherRegistry -> authorizationManagerRequestMatcherRegistry
|
||||
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
|
||||
.requestMatchers("/login").permitAll()
|
||||
.anyRequest().authenticated())
|
||||
.httpBasic(withDefaults());
|
||||
return http.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.baeldung.springbootsecurityrest.controller;
|
|||
import java.security.Principal;
|
||||
import java.util.Base64;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
|
Loading…
Reference in New Issue