Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass the remote_user variable from apache to apache using proxypassreverse

Tags:

apache

I have web application accessed via IBM IHS, this application is Tivoli ldap authenticated. from this application I have to click on link which should be served by another Apache server but I have to pass the username with the request so the other application server will populate data based on the user name passed from IBM IHS server. I'm able to open the other link via proxypassreverse rule inside httpd.conf but I'm not able to 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
like image 332
Abdallah Beydoun Avatar asked Oct 28 '25 01:10

Abdallah Beydoun


1 Answers

do NOT use the following, because you will get into trouble with execution phases if the REMOTE_USER is set with a module like mod_authn_ntlm (ntlm with local computer, 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

instead 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
like image 164
h0nIg Avatar answered Oct 31 '25 13:10

h0nIg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!