I have read a lot of answers but couldn't able to find anything satisfactory. The user roles in the application depend on the information I will receive in headers. I have already tried this:
var req = new XMLHttpRequest(); req.open('GET', document.location,false); req.send(null);
var headers = req.getAllResponseHeaders().toLowerCase(); alert(headers);
But i think i generates a new request and by then the URL changes so the headers are not the same. If there is any other option to get the headers please guide me with the same
Edit 1 (This will clarify the question a little more):
- The user would click on my application(Let's say application1) link via another application (Let's say application2).
- Then the applicaion2 will send the HTTP/HTTPs headers in requests forwarded by the reverse proxy, which will contain user role and some more information.
- In the headers I will receive user roles.
- Depending on the role the kind of access would be determined and given to user