0

I have a scenario in which the IHS server is used as a reverse proxy. Any request from the browser reaches the webserver (ie IHS) and IHS redirects the request to the corresponding URL. Similarly the response will return back to IHS and then to the browser. Now I need to include the user ID in the response header. This user ID which I need to include in the header needs to be obtained from the body of the response.

Please help if this is possible as I am new to IHS.

Krisztián Balla
  • 19,223
  • 13
  • 68
  • 84
goutham
  • 233
  • 1
  • 2
  • 6

1 Answers1

0

You can't do this in an Apache-based proxy server. Headers are sent before the body, and the body is not buffered and scanned for content in any standard Apache module.

If you need to set a response header to the logged in user, do it in your application.

covener
  • 17,402
  • 2
  • 31
  • 45
  • Thank you Covener. But the application is angular application and gets downloaded to the browser. The reason to set the user ID in the header response is because there is ISAM between the browser and web server. The ISAM needs to read the header which includes the user ID before the response reach the browser. This is for security purpose. – goutham Jan 20 '18 at 14:29
  • I don't really understand the "but" here. Are you saying there's no server behind IHS generating the response that could set the header? – covener Jan 21 '18 at 13:09
  • The URL we hit is a thirdparty authentication URL and they dont set the USER ID in the header .Instead they set it in the body. So I need to read the body and set it in the header before it reaches ISAM. – goutham Jan 21 '18 at 19:31
  • If the authentication URL is different, How does the server that generates the page know the username to incorporate it? And if they do, why can't you add the header in that context? It's too late to fish it out of the response. – covener Jan 21 '18 at 20:18
  • When the user login to the portal , I will send the credential details in the body of the restful API. The flow is from browser to ISAM , ISAM to IHS , IHS to Third party . The Third party perfrms authentication and sends the user ID in the body to IHS. IHS will have to set the ID in th header as the Next ISAM will create session based on the header before it reaches Browser. Thank you Covener. If it can not be done like this then I will think for other options. – goutham Jan 22 '18 at 02:01