How to pass remote_user variable from apache to apache using proxypassreverse
I have a web application accessible through IBM IHS, this application is authenticated by Tivoli ldap. from this application, I have to click on a link that another Apache server should serve, but I need to pass a username with a request to have another application server populate the data based on the username passed from the IBM IHS server. I can open another link using the proxypassreverse rule inside httpd.conf, but I cannot pass the remote_user header variable
rules added to httpd.conf
ProxyPass /ebill_testselfcare http://10.243.97.24/ebill_testselfcare
ProxyPassReverse /ebill_testselfcare http://10.243.97.24/ebill_testselfcare
RewriteEngine on
RewriteCond %{IS_SUBREQ} ^false$
RewriteCond %{LA-U:REMOTE_USER} (.+)
RewriteRule .* - [E=PROXY_USER:%{LA-U:REMOTE_USER}]
RequestHeader set REMOTE_USER %{PROXY_USER}e
source to share
DO NOT use the following because you will have runtime problems if REMOTE_USER is installed with a module of type mod_authn_ntlm (ntlm with local machine, see https://support.microsoft.com/en-us/kb/896861 ).
RewriteCond %{LA-U:REMOTE_USER} (.+)
RewriteRule . - [E=RU:%1]
RequestHeader set X-Remote-User %{RU}e
use the following methods:
RequestHeader set X-Remote-User expr=%{REMOTE_USER}
there is also a solution with mod_ssl
RequestHeader set X-Remote-User %{REMOTE_USER}s
source to share