JAVA-12390 Enabled CORS (#13208)
This commit is contained in:
parent
947f992d84
commit
58069ea225
|
@ -1,5 +1,7 @@
|
|||
package com.baeldung.springbootsecurityrest.basicauth.config;
|
||||
|
||||
import static org.springframework.security.config.Customizer.withDefaults;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.HttpMethod;
|
||||
|
@ -27,6 +29,7 @@ public class BasicAuthConfiguration {
|
|||
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
http.csrf()
|
||||
.disable()
|
||||
.cors(withDefaults())
|
||||
.authorizeRequests()
|
||||
.antMatchers(HttpMethod.OPTIONS, "/**")
|
||||
.permitAll()
|
||||
|
|
Loading…
Reference in New Issue