I have an IIS instance configured with Windows Authentication and URL Rewrite, so it basically works as a reverse proxy. My backend server (run on Linux) expects a REMOTE_USER header. Is it possible to configure IIS to pass information about the authenticated user to the backend server?
I have an IIS instance configured with Windows Authentication and URL Rewrite, so it
Share
If IIS is configured for
Windows Auth, thenARRwill challenge and only forward requests once the user is authenticated.It is possible to forward custom headers with the request using a
HTTPnaming convention andserverVariableselement in the rewrite rules. For instance, in the following example the server variableLOCAL_ADDRis forwarded as a header namedX-MY-HEADER.Unfortunately it’s not possible to use this technique to forward a
REMOTE_USERheader. This is because when theAuthorizationheader is present, the request is forwarded before the authentication module runs, and therefore auth server variables are not set (when mapped to headers they simply come through blank).You can however set IIS to use
Basic Windows Auth, and then extract the username from theBase64encodedAuthorizationheader on your Linux server.