This is a patch for dealing with Mozilla Lighting Bug#247486
https://bugzilla.mozilla.org/show_bug.cgi?id=247486
It changes the HTTP Auth realm to include the uniq URL for the user's calendar.
So, the Mozilla password manager can create a new saved password. If the HTTP Auth realm is always the same, Mozilla can only save only 1 password per Caldav server. The result is that you can only subscribe to 1 davical calendar per davical server.
patch against /inc/HTTPAuthSession.php using diff -Naur old new
The HTTP header sent is like:
URLs:
https://calendar.example.com/davilcal/caldav.php/username/home/
https://calendar.example.com/davilcal/caldav.php/username/
Header:
WWW-Authenticate: Basic realm="Davical CalDAV URL /davical/caldav.php/username"'
Hi Oliver,
You seem to treat this issue as a bug, but it's far from that. In the normal course of events you are expected to sign on to every calendar on the server as the same user, and to use the user permissions to control access for each user to the calendars they use.
If you have an unusual requirement where you want to sign on to different calendars as a different user, and so you want the realm to vary on a per-calendar (or per-principal) basis, then it really needs to be controlled by a non-default configuration setting, because it is most definitely *not* normal!
I'm also curious to understand your use-case, and why it cannot be met by the granting of permissions to each user to access the needed calendars (and/or membership of groups granted that access).
So, while I'm happy to accept a patch along these lines, the behaviour needs to be:
(a) off by default
(b) controlled by a configuration setting
Thanks,
Andrew.
Hi Andrew,
no problem, I agree it should be a configuration option and off by default.
Also the header sent can be changed too.
Many thanks
Oliver
One (cosmetic) improvement would be to use system_name instead of your
hard-coded "Davical CalDAV" name:
$auth_header = sprintf( 'WWW-Authenticate: Basic realm="%s URL %s"',
$c->system_name, $realm);