I'm building app with react typescript vite, dockerized and running on apache reverse proxy. Now, I've added LDAP user auth on apache and set user attributes.
If I use a PHP Page with "getallheaders()" method por $_SERVER[ variable] allí works fine.
But I can't get the same result on react typescript with vite for attributes (or headers) from apache. Thanks for any help
CodePudding user response:
If you are using fetch('/') for example you should be able to get the information as follows:
const headers = response.headers;
const ldapUserAttribute = headers.get('LDAP_USER_ATTRIBUTE');