You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Chudamani Padhan <pc...@gmail.com> on 2018/09/20 11:41:26 UTC
[users@httpd] REMOTE_USER is not available at the time of external function call in
httpd RewriteMap
Hi,
I am trying to set HTTP basic auth header for an user which is already
authenticated by external application. For doing that, we have to set
base64 encoded of "username:dummy" where password is any dummy value. In
ssl config, REMOTE_USER is getting captured properly in RequestHeader(Line
5) but not in RewriteRule (Line 3). In line 3, I tried with REMOTE_USER,
LA-U:REMOTE_USER, HTTP:REMOTE_USER. But all these variables are null. Am I
missing any config here?
ssl.conf
Line 1- RewriteEngine on
Line 2- RewriteMap base64map "prg:/opt/scripts/base64.pl"
Line 3- RewriteRule .* -
[E=AUTHN:${base64map:%{LA-U:REMOTE_USER}:%{LA-U:REMOTE_USER}},NE]
Line 4- RequestHeader set Authorization "Basic %{AUTHN}e"
Line 5- RequestHeader set X-Remote-User2 %{REMOTE_USER}s
Thanks,
Chudamani
[users@httpd] Re: REMOTE_USER is not available at the time of external function
call in httpd RewriteMap
Posted by Chudamani Padhan <pc...@gmail.com>.
Got one solution to set basic authorization header for REMOTE_USER using
AuthBasicFake (as I was mainly looking for User, not password).
<Location /*>
AuthBasicFake %{REMOTE_USER}
</Location>
Thanks,
Chudamani
On Thu, Sep 20, 2018 at 5:11 PM Chudamani Padhan <pc...@gmail.com>
wrote:
> Hi,
> I am trying to set HTTP basic auth header for an user which is already
> authenticated by external application. For doing that, we have to set
> base64 encoded of "username:dummy" where password is any dummy value. In
> ssl config, REMOTE_USER is getting captured properly in RequestHeader(Line
> 5) but not in RewriteRule (Line 3). In line 3, I tried with REMOTE_USER,
> LA-U:REMOTE_USER, HTTP:REMOTE_USER. But all these variables are null. Am I
> missing any config here?
>
>
> ssl.conf
>
> Line 1- RewriteEngine on
> Line 2- RewriteMap base64map "prg:/opt/scripts/base64.pl"
> Line 3- RewriteRule .* -
> [E=AUTHN:${base64map:%{LA-U:REMOTE_USER}:%{LA-U:REMOTE_USER}},NE]
> Line 4- RequestHeader set Authorization "Basic %{AUTHN}e"
>
> Line 5- RequestHeader set X-Remote-User2 %{REMOTE_USER}s
>
> Thanks,
> Chudamani
>