[2023-08-08]

- login Auth API 변경
- 불필요 API 삭제
main
Chung10Kr 2 years ago
parent 4564a608ad
commit fc463e0704

@ -52,8 +52,7 @@ public class AuthenticInterceptor extends WebContentInterceptor {
} else {
log.debug("AuthenticInterceptor Fail!!!!!!!!!!!!================== ");
// ModelAndView modelAndView = new ModelAndView("redirect:/uat/uia/egovLoginUsr.do");
ModelAndView modelAndView = new ModelAndView("redirect:http://localhost:3000/login");
throw new ModelAndViewDefiningException(modelAndView);
}

@ -57,20 +57,17 @@ public class EgovConfigWebDispatcherServlet implements WebMvcConfigurer {
.addPathPatterns(
// "/cop/com/*.do",
// "/cop/bbs/*Master*.do",
"/uat/uia/*.do")
"/auth/*")
.excludePathPatterns(
"/uat/uia/actionLogin.do",
"/uat/uia/actionLoginAPI.do",
"/uat/uia/actionLoginJWT.do",
"/uat/uia/egovLoginUsr.do",
"/uat/uia/egovLoginUsrAPI.do",
"/uat/uia/actionLogoutAPI.do"
"/auth/login",
"/auth/login-jwt",
"/auth/logout"
);
registry.addInterceptor(new CustomAuthenticInterceptor())
.addPathPatterns(
"/**/*.do")
.excludePathPatterns(
"/uat/uia/**");
"/auth/**");
}
// -------------------------------------------------------------

@ -33,8 +33,8 @@ public class SecurityConfig {
private String[] AUTH_WHITELIST = {
"/",
"/login/**",
"/uat/uia/actionLoginJWT.do",//JWT 로그인
"/uat/uia/actionLoginAPI.do",//일반 로그인
"/auth/login-jwt",//JWT 로그인
"/auth/login",//일반 로그인
"/cmm/main/**.do", // 메인페이지
"/cmm/fms/FileDown.do", //파일 다운로드
"/cmm/fms/getImage.do", //갤러리 이미지보기

@ -89,7 +89,7 @@ public class EgovLoginApiController {
@ApiResponse(responseCode = "200", description = "로그인 성공"),
@ApiResponse(responseCode = "300", description = "로그인 실패")
})
@PostMapping(value = "/uat/uia/actionLoginAPI.do", consumes = {MediaType.APPLICATION_JSON_VALUE , MediaType.TEXT_HTML_VALUE})
@PostMapping(value = "/auth/login", consumes = {MediaType.APPLICATION_JSON_VALUE , MediaType.TEXT_HTML_VALUE})
public HashMap<String, Object> actionLogin(@RequestBody LoginVO loginVO, HttpServletRequest request) throws Exception {
HashMap<String,Object> resultMap = new HashMap<String,Object>();
@ -121,7 +121,7 @@ public class EgovLoginApiController {
@ApiResponse(responseCode = "200", description = "로그인 성공"),
@ApiResponse(responseCode = "300", description = "로그인 실패")
})
@PostMapping(value = "/uat/uia/actionLoginJWT.do")
@PostMapping(value = "/auth/login-jwt")
public HashMap<String, Object> actionLoginJWT(@RequestBody LoginVO loginVO, HttpServletRequest request, ModelMap model) throws Exception {
HashMap<String, Object> resultMap = new HashMap<String, Object>();
@ -170,7 +170,7 @@ public class EgovLoginApiController {
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "로그아웃 성공"),
})
@GetMapping(value = "/uat/uia/actionLogoutAPI.do")
@GetMapping(value = "/auth/logout")
public ResultVO actionLogoutJSON(HttpServletRequest request, HttpServletResponse response) throws Exception {
ResultVO resultVO = new ResultVO();

@ -80,7 +80,7 @@ public class EgovLoginApiControllerTest {
HttpEntity request = new HttpEntity(params,headers);
TestRestTemplate rest = new TestRestTemplate();
ResponseEntity<HashMap> res = rest.exchange(this.SERVER_URL + "/uat/uia/actionLoginJWT.do", HttpMethod.POST,request , HashMap.class);
ResponseEntity<HashMap> res = rest.exchange(this.SERVER_URL + "/auth/login-jwt", HttpMethod.POST,request , HashMap.class);
assertThat( res.getStatusCode() ).isEqualTo( HttpStatus.OK );
HashMap<String,Object> body = (HashMap<String,Object>) res.getBody();

Loading…
Cancel
Save