[squid-users] Base64 encoding of X-Authenticated-User Request Header

Amos Jeffries squid3 at treenet.co.nz
Fri Feb 4 12:45:30 UTC 2022


On 4/02/22 21:43, Nolan wrote:
> Hi All!
> 
> I'm using a Squid proxy instance to authenticate users on the local LAN 
> and then forward requests to an upstream proxy.
> I'm trying to figure out a way to do a base64 encoding of the 
> X-Authenticated-User request header.
> 
> Right now I have the following line:
> request_header_add X-Authenticated-User "%un" all
> 
> I'm just missing the component to convert that %un value into base64 format.
> 
> Any ideas on how to do this?
> 


Firstly, why are you using that X- header?

Squid configured with a cache_peer should be able to pass on the 
username in Basic auth headers.


Secondly, base64 encoding is not currently supported for the format codes.

For now, you will have to either have the authenticator or an 
external_acl_type helper provide Squid with the base64 encoded form and 
use the %note code to generate the header.


PS. I am happy to provide a patch adding base64 encoding to logformat's. 
If you (or anyone) wants to sponsor it please contact me.


Amos


More information about the squid-users mailing list