[설정] SSO ON OFF 추가
This commit is contained in:
@@ -31,9 +31,6 @@ 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);
|
||||
@@ -56,25 +53,8 @@ public class SecurityConfig {
|
||||
public SecurityFilterChain apiFilterChain(HttpSecurity http, JwtAuthenticationFilter jwtAuthenticationFilter) throws Exception {
|
||||
http
|
||||
.cors(Customizer.withDefaults())
|
||||
.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
|
||||
.csrf(csrf -> csrf.disable())
|
||||
.exceptionHandling(ex -> ex
|
||||
.authenticationEntryPoint(new JwtAuthenticationEntryPoint())
|
||||
.accessDeniedHandler(new JwtAccessDeniedHandler())
|
||||
)
|
||||
|
||||
@@ -37,10 +37,6 @@ cookie:
|
||||
domain:
|
||||
name: ALIST_SESSION
|
||||
|
||||
app:
|
||||
sso:
|
||||
enabled: false
|
||||
|
||||
swagger:
|
||||
login:
|
||||
id: alist
|
||||
|
||||
@@ -36,13 +36,9 @@ jwt:
|
||||
|
||||
cookie:
|
||||
secure: true # 프로젝트 환경 (HTTPS)
|
||||
domain: pjt.kr
|
||||
domain: # pjt.kr # sso 인증시 주석해제
|
||||
name: ALIST_SESSION
|
||||
|
||||
app:
|
||||
sso:
|
||||
enabled: ${SSO_ENABLED:true}
|
||||
|
||||
swagger:
|
||||
login:
|
||||
id: ${SWAGGER_ID}
|
||||
|
||||
Reference in New Issue
Block a user