[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[users@httpd] Re: REMOTE_USER is not available at the time of external function call in httpd RewriteMap

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}


On Thu, Sep 20, 2018 at 5:11 PM Chudamani Padhan <pchudamani006@xxxxxxxxx> wrote:
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?


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