1

I have a requirement to integrate Angular 2 application with a Identity mangagement system. When user is successfully authenticated, few information will be sent in http headers to Angular 2 application. Could you please share some idea on how to read headers values in Angular 2.

Thanks.

Anand
  • 245
  • 4
  • 15
  • Possible dup of http://stackoverflow.com/questions/36423388/how-to-get-value-in-response-header-angular2 – ulubeyn May 18 '17 at 11:12
  • Hi, thanks for the response. However its a different scenario, (i.e. headers are posted to Angular 2 app by an external system and we need to read it). – Anand May 18 '17 at 11:41

1 Answers1

1

Well, as mentioned in many websites we really can't read http headers at the client side (using javascript) if the call is not initiated by itself. If client side application initiates a http request then it is possible to set headers in the request and read headers from the response. So that answers it all, although there are few workarounds (that I read as part of this investigation) such as using workerservice etc. I have come to the conclusion to change our design. (i.e. calling identity management system to request for specific detail instead of trying to read from http headers.)

Anand
  • 245
  • 4
  • 15