[설정] SSO ON OFF 추가

This commit is contained in:
2026-03-10 15:10:32 +09:00
parent 290c25aa21
commit 2103183bf5
3 changed files with 30 additions and 3 deletions
@@ -31,6 +31,9 @@ public class SecurityConfig {
@Value("${swagger.login.password}")
private String swaggerLoginPassword;
@Value("${app.sso.enabled:true}")
private boolean ssoEnabled;
@Bean
public JwtAuthenticationFilter jwtAuthenticationFilter(JwtTokenProvider jwtTokenProvider) {
return new JwtAuthenticationFilter(jwtTokenProvider);
@@ -53,9 +56,25 @@ public class SecurityConfig {
public SecurityFilterChain apiFilterChain(HttpSecurity http, JwtAuthenticationFilter jwtAuthenticationFilter) throws Exception {
http
.cors(Customizer.withDefaults())
.csrf(csrf -> csrf.disable())
// SSO를 위해 Spring Session 사용 (sessionManagement 설정 제거하여 기본값 사용)
.exceptionHandling(ex -> ex
.csrf(csrf -> csrf.disable());
if (!ssoEnabled) {
log.warn("SSO disabled mode enabled. Limited endpoints are opened for development.");
http
.authorizeHttpRequests(auth -> auth
.requestMatchers(
"/",
"/actuator/health",
"/auth/**",
"/test/**",
"/files/**"
).permitAll()
.anyRequest().authenticated()
);
return http.build();
}
http .exceptionHandling(ex -> ex
.authenticationEntryPoint(new JwtAuthenticationEntryPoint())
.accessDeniedHandler(new JwtAccessDeniedHandler())
)
@@ -37,6 +37,10 @@ cookie:
domain:
name: ALIST_SESSION
app:
sso:
enabled: false
swagger:
login:
id: alist
+4
View File
@@ -39,6 +39,10 @@ cookie:
domain: pjt.kr
name: ALIST_SESSION
app:
sso:
enabled: ${SSO_ENABLED:true}
swagger:
login:
id: ${SWAGGER_ID}