커스텀 로그인 페이지 연결
@d8a943c5092476a3be36f5ee0b9ec8a9114914f0
--- CHANGELOG_BOOT_JPA.md
+++ CHANGELOG_BOOT_JPA.md
... | ... | @@ -422,3 +422,11 @@ |
| 422 | 422 |
### DB 설정 기본값 적용 |
| 423 | 423 |
- `/Users/beom/Documents/intellij/cms/FoxeduBaseCMS/base/src/main/resources/application.yml` |
| 424 | 424 |
- datasource 기본값을 요청한 MariaDB 접속 정보로 변경 |
| 425 |
+ |
|
| 426 |
+## 추가 변경(23차) |
|
| 427 |
+ |
|
| 428 |
+### 로그인 페이지 연결 |
|
| 429 |
+- `/Users/beom/Documents/intellij/cms/FoxeduBaseCMS/base/src/main/java/com/foxedu/basecms/config/SecurityConfig.java` |
|
| 430 |
+ - 스프링 시큐리티 기본 로그인 비활성화 |
|
| 431 |
+ - 커스텀 로그인 페이지(`/uat/uia/egovLoginUsr.do`)로 연결 |
|
| 432 |
+ - CSRF 비활성화 |
+++ base/src/main/java/com/foxedu/basecms/config/SecurityConfig.java
... | ... | @@ -0,0 +1,28 @@ |
| 1 | +package com.foxedu.basecms.config; | |
| 2 | + | |
| 3 | +import org.springframework.context.annotation.Bean; | |
| 4 | +import org.springframework.context.annotation.Configuration; | |
| 5 | +import org.springframework.security.config.annotation.web.builders.HttpSecurity; | |
| 6 | +import org.springframework.security.web.SecurityFilterChain; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * 스프링 시큐리티 기본 로그인 비활성화 및 커스텀 로그인 연결 | |
| 10 | + */ | |
| 11 | +@Configuration | |
| 12 | +public class SecurityConfig { | |
| 13 | + | |
| 14 | + @Bean | |
| 15 | + public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { | |
| 16 | + http | |
| 17 | + // 기존 세션 기반 인증 흐름을 막지 않도록 전체 허용 | |
| 18 | + .authorizeHttpRequests(auth -> auth.anyRequest().permitAll()) | |
| 19 | + // 커스텀 로그인 페이지로 연결 | |
| 20 | + .formLogin(form -> form.loginPage("/uat/uia/egovLoginUsr.do").permitAll()) | |
| 21 | + // 기본 로그인/기본 인증 비활성화 | |
| 22 | + .httpBasic(httpBasic -> httpBasic.disable()) | |
| 23 | + // 레거시 폼과의 호환을 위해 CSRF 비활성화 | |
| 24 | + .csrf(csrf -> csrf.disable()); | |
| 25 | + | |
| 26 | + return http.build(); | |
| 27 | + } | |
| 28 | +} |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?