I have an application made with React on GAE protected by IAP.
I would like to show the logged in user's email address on the app page.
According to the documentation, there is a header named "x-goog-iap-jwt-assertion" that includes identified user information in the request header.
I successfully retrieved the request header in Nodejs with Express, but couldn't retrieve this request header data in React.
Is there a way to retrieve this request header data in React?
UPDATE
i have tried axios.get("/").then(res => console.log(res.headers));
and it returns
{
"alt-svc": "h3-27=\":443\"; ma=2592000, h3-25=\":443\"; ma=2592000, h3-T050=\":443\"; ma=2592000, h3-Q050=\":443\"; ma=2592000, h3-Q049=\":443\"; ma=2592000, h3-Q048=\":443\"; ma=2592000, h3-Q046=\":443\"; ma=2592000, h3-Q043=\":443\"; ma=2592000",
"cache-control": "no-cache, must-revalidate",
"content-encoding": "gzip",
"content-type": "text/html",
"date": "Mon, 08 Jun 2020 08:02:21 GMT",
"etag": "\"AdbtXg\"",
"expires": "Fri, 01 Jan 1990 00:00:00 GMT",
"pragma": "no-cache",
"server": "Google Frontend",
"x-cloud-trace-context": "c6266644decdc531641c3f57a99ef645",
"x-firefox-spdy": "h2"
}