Skip to content

Commit aaede13

Browse files
committed
fix: 설정
1 parent 7d5f2c3 commit aaede13

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed
0 Bytes
Binary file not shown.
6.69 KB
Binary file not shown.
36.2 KB
Binary file not shown.

Location-based-target-authentication/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '3.2.2'
4-
id 'io.spring.dependency-management' version '1.1.7'
3+
id 'org.springframework.boot' version '3.2.1'
4+
id 'io.spring.dependency-management' version '1.1.4'
55
}
66

77
group = 'com.swyp'

Location-based-target-authentication/src/main/java/com/swyp/global/config/OAuth2Config.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,25 @@
1111
import org.springframework.security.oauth2.core.ClientAuthenticationMethod;
1212
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
1313
import org.springframework.security.web.SecurityFilterChain;
14+
import org.springframework.security.config.Customizer;
15+
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
1416

1517
@Configuration
1618
@EnableWebSecurity
1719
public class OAuth2Config {
1820

21+
@Bean
22+
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
23+
http
24+
.csrf(AbstractHttpConfigurer::disable)
25+
.authorizeHttpRequests(auth -> auth
26+
.requestMatchers("/", "/error", "/login/**", "/oauth2/**", "/swagger-ui/**", "/v3/api-docs/**").permitAll()
27+
.anyRequest().authenticated()
28+
)
29+
.oauth2Login(Customizer.withDefaults());
30+
return http.build();
31+
}
32+
1933
@Value("${spring.security.oauth2.client.registration.google.client-id}")
2034
private String googleClientId;
2135

0 commit comments

Comments
 (0)