<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Journal Entry</title>
<style type="text/css">
input{
width:150px;
}
button{
width:200px;
height:20px;
}
body{
left: 50%!important;
position: relative!important;
top: 20%!important;
}
</style>
<script type="text/javascript" src="/cordys/wcp/application.js"></script>
<script type="text/javascript">
function redirect()
{
var requestString =
"<SOAP:Envelope xmlns:SOAP=\"http://schemas.xmlsoap.org/soap/envelope/\">"+
"<SOAP:Header>"+
"<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">"+
"<wsse:UsernameToken xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">"+
"<wsse:Username>"+userId.value+"</wsse:Username>"+
"<wsse:Password>"+pwd.value+"</wsse:Password>"+
"</wsse:UsernameToken>"+
"</wsse:Security>"+
"</SOAP:Header>"+
"<SOAP:Body>"+
"<samlp:Request xmlns:samlp=\"urn:oasis:names:tc:SAML:1.0:protocol\" MajorVersion=\"1\" MinorVersion=\"1\">"+
"<samlp:AuthenticationQuery>"+
"<saml:Subject xmlns:saml=\"urn:oasis:names:tc:SAML:1.0:assertion\">"+
"<saml:NameIdentifier Format=\"urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified\">"+userId.value+"</saml:NameIdentifier>"+
"</saml:Subject>"+
"</samlp:AuthenticationQuery>"+
"</samlp:Request>"+
"</SOAP:Body>"+
"</SOAP:Envelope>";
// We dont need to specify http://Hostname/ part
var cordysGatewayURL = "https://dhl-hyd1024.darkhorseboa.com:443/cordys/com.eibus.web.soap.Gateway.wcp";
var xmlhttp = cordys.getConnection();
xmlhttp.open("POST", cordysGatewayURL, false);
xmlhttp.send(requestString);
var responseXMLDOC = cordys.loadXMLDocument(xmlhttp.responseText) ;
var validUser = (cordys.selectXMLNode(responseXMLDOC,".//*[local-name()='Fault']/*[local-name()='faultstring']") == null);
if(validUser){
system.samlInfo=new Object();
system.samlInfo.eventData=responseXMLDOC;
document.getElementById("ssologin").setAssertions(responseXMLDOC);
window.location.href = "homepage_bkp.htm";
}
else
alert("invalid User");
}
</script>
</head>
<body>
<div id="ssologin" cordysType="wcp.library.system.SSO"></div>
UserName <input id="userId"/><br/><br/>
Password <input id="pwd"> <br/><br/>
<button id="submit" name="Submit" onclick="redirect()">Submit</button>
</body>
</html>
<html>
<head>
<title>Journal Entry</title>
<style type="text/css">
input{
width:150px;
}
button{
width:200px;
height:20px;
}
body{
left: 50%!important;
position: relative!important;
top: 20%!important;
}
</style>
<script type="text/javascript" src="/cordys/wcp/application.js"></script>
<script type="text/javascript">
function redirect()
{
var requestString =
"<SOAP:Envelope xmlns:SOAP=\"http://schemas.xmlsoap.org/soap/envelope/\">"+
"<SOAP:Header>"+
"<wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">"+
"<wsse:UsernameToken xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">"+
"<wsse:Username>"+userId.value+"</wsse:Username>"+
"<wsse:Password>"+pwd.value+"</wsse:Password>"+
"</wsse:UsernameToken>"+
"</wsse:Security>"+
"</SOAP:Header>"+
"<SOAP:Body>"+
"<samlp:Request xmlns:samlp=\"urn:oasis:names:tc:SAML:1.0:protocol\" MajorVersion=\"1\" MinorVersion=\"1\">"+
"<samlp:AuthenticationQuery>"+
"<saml:Subject xmlns:saml=\"urn:oasis:names:tc:SAML:1.0:assertion\">"+
"<saml:NameIdentifier Format=\"urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified\">"+userId.value+"</saml:NameIdentifier>"+
"</saml:Subject>"+
"</samlp:AuthenticationQuery>"+
"</samlp:Request>"+
"</SOAP:Body>"+
"</SOAP:Envelope>";
// We dont need to specify http://Hostname/ part
var cordysGatewayURL = "https://dhl-hyd1024.darkhorseboa.com:443/cordys/com.eibus.web.soap.Gateway.wcp";
var xmlhttp = cordys.getConnection();
xmlhttp.open("POST", cordysGatewayURL, false);
xmlhttp.send(requestString);
var responseXMLDOC = cordys.loadXMLDocument(xmlhttp.responseText) ;
var validUser = (cordys.selectXMLNode(responseXMLDOC,".//*[local-name()='Fault']/*[local-name()='faultstring']") == null);
if(validUser){
system.samlInfo=new Object();
system.samlInfo.eventData=responseXMLDOC;
document.getElementById("ssologin").setAssertions(responseXMLDOC);
window.location.href = "homepage_bkp.htm";
}
else
alert("invalid User");
}
</script>
</head>
<body>
<div id="ssologin" cordysType="wcp.library.system.SSO"></div>
UserName <input id="userId"/><br/><br/>
Password <input id="pwd"> <br/><br/>
<button id="submit" name="Submit" onclick="redirect()">Submit</button>
</body>
</html>
No comments:
Post a Comment