티스토리 뷰

예전에 스프링에서 제공하는 /jsession 머라머라를 이용해서 이기종 시스템간 로그인을 구현했는데..


너무 어려웠다.


되다 안되다... 아예 되질 말지.. 되다 끊기다 하니까 짜증났다.


불만은 늘어가고..


그러나..


웹서비스를 이용해서 이기종 시스템간 로그인을 구현하니 잘됐다.


그렇게 /jsession 으로 고생했었는데.. 그때 웹서비스를 이용한 로그인을 알았더라면..


더 공부를 해야 겠다..


String employee = "blabla";


employee = Aes.encode(employee, "SYS_USR");


String sessId = request.getSession().getId();


AuthUser user = (AuthUser)request.getSession().getAttribute("authUser");


String userId = user.getEmplyee();


ReqTokenVO reqToken = new ReqTokenVO();


reqToken.setAuthKey("afjakkj");


reqToken.setPtlSessionId(sessId);


String url = "http://aaa.com:10000?wsdl";


URL wsdlURL = null;


try{

    wsdlURL = new URL(url);

}catch(MalformedURLException e){

    e.printStackTrace();

}


QName SERVICE_NAME = new QName("localhost","AuthService");


Service service = Service.create(wsdlURL, SERVICE_NAME);


AuthService client = service.getPort(AuthService.class);


TokenVO returnVal = client.getToken(reqToken);


mv.addObject("authStatus", returnVal.getAuthStatus());

mv.addObject("pltSessionId", returnVal.getPtlSessionId());

mv.addObject("tokenStr", returnVal.getTokenStr());

mv.setViewName("/aaa");


이렇게 모델에서 값을 세팅해주고 view로 와서


<iframe name="ifname" width="100%" height="100%" style="position: absolute; top:0; padding-top:78px; border:0 none;"></iframe>

<form id="paramsForm" name="paramsForm" method="POST">

    <input type='hidden' name='sabun' id='sabun' value="${userId}">

    <input type='hidden' name='getPtlSessionId' id='getPtlSessionId' value="${getPtlSessionId}">

    <input type='hidden' name='tokenStr' id='tokenStr' value="${tokenStr}">

    <input type='hidden' name='retUrl' id='retUrl' value="${retUrl}">

</form>


<script>

$(document).ready(function(){

    document.paramsForm.target="ifname";

    document.paramsForm.action="http://aaa.com";

    document.paramsForm.submit();

})

</script>

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함