이지우 - e배움터 로그인 cors 수정 중
This commit is contained in:
parent
7347601133
commit
9445f7584c
6
pom.xml
6
pom.xml
@ -69,6 +69,12 @@
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<!-- https://mvnrepository.com/artifact/com.thetransactioncompany/cors-filter -->
|
||||
<dependency>
|
||||
<groupId>com.thetransactioncompany</groupId>
|
||||
<artifactId>cors-filter</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>egovframework.rte</groupId>
|
||||
<artifactId>egovframework.rte.fdl.security</artifactId>
|
||||
|
||||
@ -16,7 +16,6 @@ import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
||||
@ -45,8 +44,9 @@ import kcc.let.utl.sim.service.EgovClntInfo;
|
||||
* @version 1.0
|
||||
* @see
|
||||
*/
|
||||
@CrossOrigin(origins = "*")
|
||||
|
||||
@Controller
|
||||
@CrossOrigin(origins = "*", methods = RequestMethod.POST)
|
||||
public class APILoginContoller {
|
||||
|
||||
/** userManageService */
|
||||
@ -67,13 +67,15 @@ public class APILoginContoller {
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/web/chkloginKeyForOffedu.do")
|
||||
public String loginKeyChkForOffedu(Map<String, String> paramRequest, RedirectAttributes redirectAttributes, HttpServletRequest request, HttpServletResponse response,HttpSession session) throws Exception {
|
||||
public String loginKeyChkForOffedu(@RequestBody Map<String, String> paramRequest, RedirectAttributes redirectAttributes, HttpServletRequest request, HttpServletResponse response,HttpSession session) throws Exception {
|
||||
String userId = paramRequest.get("user_id");
|
||||
String key = paramRequest.get("key");
|
||||
//String returnUrl = paramRequest.get("returnUrl"); //e-배움터 문의결과 returnUrl 컨트롤은 불가능하다고 함
|
||||
String returnUrl = "";
|
||||
|
||||
System.out.println("@@@@@@@e배움터 로그인 페이지에서 오는 메소드 or e배움터 로그인 상태에서 오는 메소드@@@@@@@@");
|
||||
System.out.println("@@@key:"+key);
|
||||
System.out.println("@@@userId:"+userId);
|
||||
//테스트를 위한 값 선언
|
||||
/*userId = "std02@forwiz.com";
|
||||
key = "std02@forwiz.comxpnBtqsev3nh9mryXRdL9QRSR72XuNc08ese5iXHb0Waq1dMnSdkHHqKCgoSFeyH.amV1c19kb21haW4vTE1T";
|
||||
|
||||
@ -19,7 +19,72 @@
|
||||
<url-pattern>*.do</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
|
||||
<!-- CORS -->
|
||||
<filter>
|
||||
<filter-name>CORS</filter-name>
|
||||
<filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>cors.allowed.origins</param-name>
|
||||
<param-value>*</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>cors.allowed.methods</param-name>
|
||||
<param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>cors.allowed.headers</param-name>
|
||||
<param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>cors.exposed.headers</param-name>
|
||||
<param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>cors.support.credentials</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>cors.preflight.maxage</param-name>
|
||||
<param-value>10</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>CORS</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
<filter>
|
||||
<filter-name>CorsFilter</filter-name>
|
||||
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>cors.allowed.origins</param-name>
|
||||
<param-value>*</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>cors.allowed.methods</param-name>
|
||||
<param-value>GET,POST,HEAD,OPTIONS,PUT,DELETE</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>cors.allowed.headers</param-name>
|
||||
<param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>cors.exposed.headers</param-name>
|
||||
<param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<!-- 쿠키 통신을 안하는데 이걸 true로 하면 4XX 서버 에러가 뜬다 -->
|
||||
<param-name>cors.support.credentials</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>cors.preflight.maxage</param-name>
|
||||
<param-value>10</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>CorsFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<!-- 템플릿 소스에서는 아래의 필터사용 대신 JSP 출력시 <c:out> 태그를 사용하는 것을 기본정책으로 한다 -->
|
||||
<!-- egovframework.rte.ptl.mvc.filter.HTMLTagFilter kcc.com.cmm.filter.HTMLTagFilter-->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user