httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Httpd Wiki] Update of "LogBasicauthenticationusername" by thumbs
Date Mon, 09 Jan 2017 17:50:20 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change notification.

The "LogBasicauthenticationusername" page has been changed by thumbs:

New page:
= Log basic authentication username all the time =

Using Anonymous basic auth with mod_auth_anon requires an Authorization header, else a 401
response will be generated.

The solution is to revert to basic HTTP auth, and using that recipe to manipulate the authorization
header, and ultimately define a new request header that can be logged.

<Location /yourpath>
  # Detaint
  # RequestHeader unset X-User

  # copy incoming header
  RequestHeader set X-User "expr=%{HTTP:Authorization}"

  # Grab the base 64 part
  RequestHeader edit X-User "^Basic (.*)$" $1

  # decode it
  RequestHeader set X-User "expr=%{unbase64:%{HTTP:X-User}}"

  # split on :
  RequestHeader edit X-User "(.*):.*$" $1

CustomLog logs/test.log "%{X-User}i"

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message