Varnish 4 Basic Authentication constantly prompts for username and password -
i'm using varnish 4 on test environment , want protect access content using basic authentication.
what want happen first request causes prompt basic auth , no longer asks once user has entered username , password. have setup rule varnish check correct authroization , ask user provide if have not.
my end users complaining repeatedly challenged basic authentication details in browser having enter 20 times before first page shown.
when using chrome browser, doesn't seem happen unless have dev tools panel open , have not cache requests dev tools panel open ticked. in various versions of ie, happens time.
in vcl, basic auth rule looks in sub vcl_recv section:
if (!req.http.authorization ~ "basic xxxxxxxxxxxxxxxxxx==" # don't require auth if ip on authpass list. && !client.ip ~ authpass # don't require auth if live website. && !req.http.host == "www.mylivesite.com") { return(synth(401, "authentication required")); } unset req.http.authorization;
i think missing in vcl_synth:
sub vcl_synth { if (resp.status == 401) { set resp.status = 401; set resp.http.www-authenticate = "basic"; return(deliver); }
check detailed answer on setting basic authentication in varnish.
Comments
Post a Comment