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