httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
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:
https://wiki.apache.org/httpd/LogBasicauthenticationusername

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
</Location>

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

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Mime
View raw message