I have my application running in nodejs server and I am now trying to integrate SiteMinder SSO to secure our application. Since there is no webagent for nodeserver, I am introducing an apache http server before node server. I installed and configured the siteminder webagent in apache http server.
In apache server (document root folder) I have an index.html page which will just redirect the request to the node js root page ('/').
When I get a request in apache, siteminder webagent throws the SSO login page and after entering the valid credential, SSO will pull up the index.html page. Now the redirection will trigger and It ends up in the root page of node js. In this point I need to access the SM http header values from the nodejs application.
But I am not able to access the http header values in both node js and apache index.html.
My index.html page looks like:
<html>
<head>
<script>
var request = new XMLHttpRequest();
request.open('GET', document.location, false);
request.send(null);
var headers = request.getAllResponseHeaders();
console.log(headers);
</script>
<meta http-equiv="refresh" content="0; URL='http://<nodeserver_hostname>:8000/'" />
</head>
<body>
<h1>It works!</h1>
</body>
</html>
Also in Node js:
var request1 = require('request');
app.get('/', (request, response, next) => {
logger.info('Loading route map')
request1("http://<hostname>", {method: 'HEAD'}, function (err, res, body){
logger.info(res.headers);
logger.info(res);
});
})