Commit 34256f59 by Masaru Abe

SSO対応

parent 34d51c56
...@@ -391,4 +391,6 @@ ...@@ -391,4 +391,6 @@
<script type="text/javascript" src="./common/js/zoomDetector.js?__UPDATEID__" ></script> <script type="text/javascript" src="./common/js/zoomDetector.js?__UPDATEID__" ></script>
<script type="text/javascript" src="./common/js/jquery.powertip.js?__UPDATEID__"></script> <script type="text/javascript" src="./common/js/jquery.powertip.js?__UPDATEID__"></script>
<script type="text/javascript" src="./common/js/script.js?__UPDATEID__"></script> <script type="text/javascript" src="./common/js/script.js?__UPDATEID__"></script>
<script type="text/javascript" src="./common/js/aes.js?__UPDATEID__"></script>
<script type="text/javascript" src="./common/js/pad-iso10126-min.js?__UPDATEID__"></script>
...@@ -5807,3 +5807,5 @@ CONTENTVIEW.webGetContentApi_funcOk = function(data){ ...@@ -5807,3 +5807,5 @@ CONTENTVIEW.webGetContentApi_funcOk = function(data){
} }
}; };
...@@ -1894,17 +1894,21 @@ CONTENTVIEW_CREATEOBJECT.linkURL = function (mediaType, actionType, id, imageUrl ...@@ -1894,17 +1894,21 @@ CONTENTVIEW_CREATEOBJECT.linkURL = function (mediaType, actionType, id, imageUrl
//--- //---
var linkUrlTmp = linkUrl; var linkUrlTmp = linkUrl;
//DHカスタム if(CONTENTVIEW_CREATEOBJECT.isSsoUrl(linkUrlTmp)){
if( ClientData.serviceOpt_daihatsu() == 'Y'){ CONTENTVIEW_CREATEOBJECT.makeSsoParam(linkUrlTmp, browserType);
var apiUrl = AVWEB.getApiUrl(ClientData.userInfo_accountPath());
linkUrlTmp = linkUrlTmp + "?sid=" + ClientData.userInfo_sid() + "&apiurl=" + apiUrl ;
}
if( browserType == 0 ){
CONTENTVIEW_CREATEOBJECT.showHtml(linkUrlTmp, objectId );
CONTENTVIEW_GENERAL.showDialog(true);
} else { } else {
window.open(linkUrlTmp, "_blank", "new window, scrollbars=yes"); //DHカスタム
if( ClientData.serviceOpt_daihatsu() == 'Y'){
var apiUrl = AVWEB.getApiUrl(ClientData.userInfo_accountPath());
linkUrlTmp = linkUrlTmp + "?sid=" + ClientData.userInfo_sid() + "&apiurl=" + apiUrl ;
}
if( browserType == 0 ){
CONTENTVIEW_CREATEOBJECT.showHtml(linkUrlTmp, objectId );
CONTENTVIEW_GENERAL.showDialog(true);
} else {
window.open(linkUrlTmp, "_blank", "new window, scrollbars=yes");
}
} }
}; };
...@@ -2981,6 +2985,99 @@ CONTENTVIEW_CREATEOBJECT.createPageBGM = function(){ ...@@ -2981,6 +2985,99 @@ CONTENTVIEW_CREATEOBJECT.createPageBGM = function(){
}; };
//END : TRB00028 - Editor: Long - Date: 09/10/2013 - Summary : Fix For Page BGM //END : TRB00028 - Editor: Long - Date: 09/10/2013 - Summary : Fix For Page BGM
//SSO対応
CONTENTVIEW_CREATEOBJECT.isSsoUrl = function(resourceUrl){
var chkUrl = "http://dlpro.daihatsu.goo-net.com/";
var chkUrlDev = "http://dlprodev.daihatsu.goo-net.com/";
//var chkUrl = "https://www.agentec.jp/";
//var chkUrlDev = "https://www.agentec.jp/";
if(chkUrl === resourceUrl || chkUrlDev === resourceUrl){
return true;
} else {
return false;
}
};
CONTENTVIEW_CREATEOBJECT.makeSsoParam = function(linkUrlTmp, browserType){
var param = "";
//システム時間取得
var params = {
sid: ClientData.userInfo_sid()
};
AVWEB.avwCmsApiSync(
ClientData.userInfo_accountPath(),
"webSso",
'GET',
params,
function (data) {
if( data.result == "success" ){
var loginId = ClientData.userInfo_loginId_session();
var aesKey = data.aesKey;
var iv = CONTENTVIEW_CREATEOBJECT.makeRandom(16);
var val = data.getSysDate;
var enc = CONTENTVIEW_CREATEOBJECT.aesEncrypt(val, aesKey, iv);
console.log("aesKey:" + aesKey);
console.log("val:" + val);
console.log("enc:" + enc);
param ="?lid=" + encodeURIComponent(loginId) + "&p=" + encodeURIComponent(enc) + "&v=" + iv;
}
linkUrlTmp = linkUrlTmp + param;
if( browserType == 0 ){
CONTENTVIEW_CREATEOBJECT.showHtml(linkUrlTmp, objectId );
CONTENTVIEW_GENERAL.showDialog(true);
} else {
window.open(linkUrlTmp, "_blank", "new window, scrollbars=yes");
}
},
function (xmlHttpRequest, txtStatus, errorThrown) {
if( browserType == 0 ){
CONTENTVIEW_CREATEOBJECT.showHtml(linkUrlTmp, objectId );
CONTENTVIEW_GENERAL.showDialog(true);
} else {
window.open(linkUrlTmp, "_blank", "new window, scrollbars=yes");
}
}
);
};
CONTENTVIEW_CREATEOBJECT.aesEncrypt = function(data, keyStr, ivStr) {
var sendData = CryptoJS.enc.Utf8.parse(data);
var key = CryptoJS.enc.Utf8.parse(keyStr);
var iv = CryptoJS.enc.Utf8.parse(ivStr);
var encrypted = CryptoJS.AES.encrypt(sendData, key,{iv:iv,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Iso10126});
return CryptoJS.enc.Base64.stringify(encrypted.ciphertext);
};
CONTENTVIEW_CREATEOBJECT.makeRandom = function(length){
var n = 62; //ランダム調整
var RandomString = '';
var BaseString ='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
//文字列生成
for(var i=0; i<length; i++) {
RandomString += BaseString.charAt( Math.floor( Math.random() * n));
}
return RandomString;
};
//SSO対応
$(function () { $(function () {
//CONTENTVIEW_CREATEOBJECT.ready(); //CONTENTVIEW_CREATEOBJECT.ready();
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment