October 21, 2024
Chicago 12, Melborne City, USA
javascript

Getting the request headers in a React website


I have a React website that is hosted by IIS. I am trying to get the request headers, specifically for CaC logins. For F5/CaC authentication, the certificate is forwarded into a request header. Using ASP.Net Core/C#, I would do something like this:

var subject = HttpContext.Request.Headers["X-SSL-Client-Cert-Subject"];

Since this website is a pure React website, I can’t seem to figure out how to get this in React, or even through React Router DOM. Is there a way to get this or is there a way to somehow get IIS to inject the request headers into my React site?



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video