From 4438d2ba9ac549f32275beac046f40f927431af7 Mon Sep 17 00:00:00 2001 From: Unrud Date: Fri, 12 Aug 2016 23:41:34 +0200 Subject: [PATCH] Require user for current-user-principal DAVdroid dropped support for preemptive authentication in version 1.2.3. Returning the DAV:unauthenticated pseudo-principal as specified in RFC 5397 doesn't seem to work for DAVdroid. --- radicale/xmlutils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index 68c76d5..5ef4b88 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -510,6 +510,12 @@ def propfind(path, xml_request, read_collections, write_collections, user): _tag("ICAL", "calendar-color"), _tag("CS", "getctag")] + if _tag("D", "current-user-principal") in props and not user: + # Ask for authentication + # Returning the DAV:unauthenticated pseudo-principal as specified in + # RFC 5397 doesn't seem to work with DAVdroid. + return client.FORBIDDEN, None + multistatus = ET.Element(_tag("D", "multistatus")) collections = [] for collection in write_collections: