-
Notifications
You must be signed in to change notification settings - Fork 107
Closed
Labels
need-feedbackNothing will be done without more info/feedback from someone that can reproduce the issueNothing will be done without more info/feedback from someone that can reproduce the issue
Milestone
Description
Authentication to a Baikal server with digest auth is failing since 2.1.0. Reverting back to 2.0.1 resolves the issue. Below you can see logs from a successful auth using 2.0.1 and a failure using 2.1.2.
Success:
DEBUG:caldav:url: https://subdomain.domain.com/dav.php/calendars/username/
DEBUG:caldav:self.url: https://subdomain.domain.com/dav.php/calendars/username/
DEBUG:caldav:sending request - method=PROPFIND, url=https://subdomain.domain.com/dav.php/calendars/username/, headers={'User-Agent': 'python-caldav/2.0.1', 'Content-Type': 'text/xml', 'Accept': 'text/xml, text/calendar', 'Depth': '0'}
body:
<?xml version='1.0' encoding='utf-8'?>
<D:propfind xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"><D:prop><D:current-user-principal/></D:prop></D:propfind>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): subdomain.domain.com:443
DEBUG:urllib3.connectionpool:https://subdomain.domain.com:443 "PROPFIND /dav.php/calendars/username/ HTTP/2.0" 401 None
DEBUG:caldav:server responded with 401 Unauthorized
DEBUG:caldav:response headers: {'server': 'openresty', 'date': 'Thu, 20 Nov 2025 20:36:30 GMT', 'content-type': 'application/xml; charset=utf-8', 'set-cookie': 'PHPSESSID=XXXXXXXXx; path=/; HttpOnly', 'expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'cache-control': 'no-store, no-cache, must-revalidate', 'pragma': 'no-cache', 'x-sabre-version': '4.7.0', 'vary': 'Brief,Prefer', 'dav': '1, 3, extended-mkcol, access-control, calendarserver-principal-property-search, calendar-access, calendar-proxy, calendar-auto-schedule, calendar-availability, resource-sharing, calendarserver-sharing, addressbook', 'www-authenticate': 'Digest realm="BaikalDAV",qop="auth",nonce="691f7bce85f46",opaque="d66d5f0524036afcb61420e358f990ce"', 'strict-transport-security': 'max-age=63072000; preload'}
DEBUG:caldav:response status: 401
DEBUG:caldav:b'<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">\n <s:sabredav-version>4.7.0</s:sabredav-version>\n <s:exception>Sabre\\DAV\\Exception\\NotAuthenticated</s:exception>\n <s:message>No \'Authorization: Digest\' header found. Either the client didn\'t send one, or the server is misconfigured. Login was needed for privilege: {DAV:}read on calendars/username</s:message>\n</d:error>\n'
DEBUG:caldav:b'<?xml version="1.0" encoding="utf-8"?>\n<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">\n <s:sabredav-version>4.7.0</s:sabredav-version>\n <s:exception>Sabre\\DAV\\Exception\\NotAuthenticated</s:exception>\n <s:message>No \'Authorization: Digest\' header found. Either the client didn\'t send one, or the server is misconfigured. Login was needed for privilege: {DAV:}read on calendars/username</s:message>\n</d:error>\n'
DEBUG:caldav:sending request - method=PROPFIND, url=https://subdomain.domain.com/dav.php/calendars/username/, headers={'User-Agent': 'python-caldav/2.0.1', 'Content-Type': 'text/xml', 'Accept': 'text/xml, text/calendar', 'Depth': '0'}
body:
<?xml version='1.0' encoding='utf-8'?>
<D:propfind xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"><D:prop><D:current-user-principal/></D:prop></D:propfind>
DEBUG:urllib3.connectionpool:https://subdomain.domain.com:443 "PROPFIND /dav.php/calendars/username/ HTTP/2.0" 401 None
DEBUG:urllib3.connectionpool:https://subdomain.domain.com:443 "PROPFIND /dav.php/calendars/username/ HTTP/2.0" 401 None
DEBUG:caldav:server responded with 401 Unauthorized
DEBUG:caldav:response headers: {'server': 'openresty', 'date': 'Thu, 20 Nov 2025 20:36:30 GMT', 'content-type': 'application/xml; charset=utf-8', 'expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'cache-control': 'no-store, no-cache, must-revalidate', 'pragma': 'no-cache', 'x-sabre-version': '4.7.0', 'vary': 'Brief,Prefer', 'dav': '1, 3, extended-mkcol, access-control, calendarserver-principal-property-search, calendar-access, calendar-proxy, calendar-auto-schedule, calendar-availability, resource-sharing, calendarserver-sharing, addressbook', 'www-authenticate': 'Digest realm="BaikalDAV",qop="auth",nonce="691f7bce9f629",opaque="d66d5f0524036afcb61420e358f990ce"', 'strict-transport-security': 'max-age=63072000; preload'}
DEBUG:caldav:response status: 401
DEBUG:caldav:b'<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">\n <s:sabredav-version>4.7.0</s:sabredav-version>\n <s:exception>Sabre\\DAV\\Exception\\NotAuthenticated</s:exception>\n <s:message>Username or password was incorrect. Login was needed for privilege: {DAV:}read on calendars/username</s:message>\n</d:error>\n'
DEBUG:caldav:b'<?xml version="1.0" encoding="utf-8"?>\n<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">\n <s:sabredav-version>4.7.0</s:sabredav-version>\n <s:exception>Sabre\\DAV\\Exception\\NotAuthenticated</s:exception>\n <s:message>Username or password was incorrect. Login was needed for privilege: {DAV:}read on calendars/username</s:message>\n</d:error>\n'
DEBUG:caldav:sending request - method=PROPFIND, url=https://subdomain.domain.com/dav.php/calendars/username/, headers={'User-Agent': 'python-caldav/2.0.1', 'Content-Type': 'text/xml', 'Accept': 'text/xml, text/calendar', 'Depth': '0'}
body:
<?xml version='1.0' encoding='utf-8'?>
<D:propfind xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"><D:prop><D:current-user-principal/></D:prop></D:propfind>
DEBUG:urllib3.connectionpool:https://subdomain.domain.com:443 "PROPFIND /dav.php/calendars/username/ HTTP/2.0" 401 None
DEBUG:urllib3.connectionpool:https://subdomain.domain.com:443 "PROPFIND /dav.php/calendars/username/ HTTP/2.0" 207 None
DEBUG:caldav:server responded with 207 Multi-Status
DEBUG:caldav:response headers: {'server': 'openresty', 'date': 'Thu, 20 Nov 2025 20:36:30 GMT', 'content-type': 'application/xml; charset=utf-8', 'expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'cache-control': 'no-store, no-cache, must-revalidate', 'pragma': 'no-cache', 'x-sabre-version': '4.7.0', 'vary': 'Brief,Prefer', 'dav': '1, 3, extended-mkcol, access-control, calendarserver-principal-property-search, calendar-access, calendar-proxy, calendar-auto-schedule, calendar-availability, resource-sharing, calendarserver-sharing, addressbook', 'strict-transport-security': 'max-age=63072000; preload'}
DEBUG:caldav:response status: 207
DEBUG:caldav:b'<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/" xmlns:card="urn:ietf:params:xml:ns:carddav">\n <d:response>\n <d:href>/dav.php/calendars/username/</d:href>\n <d:propstat>\n <d:prop>\n <d:current-user-principal>\n <d:href>/dav.php/principals/username/</d:href>\n </d:current-user-principal>\n </d:prop>\n <d:status>HTTP/1.1 200 OK</d:status>\n </d:propstat>\n </d:response>\n</d:multistatus>\n'
DEBUG:caldav:b'<?xml version="1.0"?>\n<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/" xmlns:card="urn:ietf:params:xml:ns:carddav"><d:response><d:href>/dav.php/calendars/username/</d:href><d:propstat><d:prop><d:current-user-principal><d:href>/dav.php/principals/username/</d:href></d:current-user-principal></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>\n'
Failure:
DEBUG:urllib3.util.retry:Converted retries value: 0 -> Retry(total=0, connect=None, read=None, redirect=None, status=None)
DEBUG:urllib3.util.retry:Converted retries value: 0 -> Retry(total=0, connect=None, read=None, redirect=None, status=None)
DEBUG:caldav:url: https://subdomain.domain.com/dav.php/calendars/username/
DEBUG:caldav:self.url: https://subdomain.domain.com/dav.php/calendars/username/
DEBUG:caldav:sending request - method=PROPFIND, url=https://subdomain.domain.com/dav.php/calendars/username/, headers={'User-Agent': 'python-caldav/2.1.2', 'Content-Type': 'text/xml', 'Accept': 'text/xml, text/calendar', 'Depth': '0'}
body:
<?xml version='1.0' encoding='utf-8'?>
<D:propfind xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"><D:prop><D:current-user-principal/></D:prop></D:propfind>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): subdomain.domain.com:443
DEBUG:urllib3.util.retry:Converted retries value: 0 -> Retry(total=0, connect=None, read=None, redirect=None, status=None)
DEBUG:urllib3.util.retry:Converted retries value: 0 -> Retry(total=0, connect=None, read=None, redirect=None, status=None)
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): e8.c.lencr.org:80
DEBUG:urllib3.connectionpool:http://e8.c.lencr.org:80 "GET /93.crl HTTP/1.1" 200 57171
DEBUG:caldav:server responded with 401 Unauthorized
DEBUG:caldav:response headers: {'server': 'openresty', 'date': 'Thu, 20 Nov 2025 20:32:43 GMT', 'content-type': 'application/xml; charset=utf-8', 'set-cookie': 'PHPSESSID=XXXXXXXXX; path=/; HttpOnly', 'expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'cache-control': 'no-store, no-cache, must-revalidate', 'pragma': 'no-cache', 'x-sabre-version': '4.7.0', 'vary': 'Brief,Prefer', 'dav': '1, 3, extended-mkcol, access-control, calendarserver-principal-property-search, calendar-access, calendar-proxy, calendar-auto-schedule, calendar-availability, resource-sharing, calendarserver-sharing, addressbook', 'www-authenticate': 'Digest realm="BaikalDAV",qop="auth",nonce="691f7aebe4ccc",opaque="d66d5f0524036afcb61420e358f990ce"', 'strict-transport-security': 'max-age=63072000; preload'}
DEBUG:caldav:response status: 401
DEBUG:caldav:b'<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">\n <s:sabredav-version>4.7.0</s:sabredav-version>\n <s:exception>Sabre\\DAV\\Exception\\NotAuthenticated</s:exception>\n <s:message>No \'Authorization: Digest\' header found. Either the client didn\'t send one, or the server is misconfigured. Login was needed for privilege: {DAV:}read on calendars/username</s:message>\n</d:error>\n'
DEBUG:caldav:b'<?xml version="1.0" encoding="utf-8"?>\n<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">\n <s:sabredav-version>4.7.0</s:sabredav-version>\n <s:exception>Sabre\\DAV\\Exception\\NotAuthenticated</s:exception>\n <s:message>No \'Authorization: Digest\' header found. Either the client didn\'t send one, or the server is misconfigured. Login was needed for privilege: {DAV:}read on calendars/username</s:message>\n</d:error>\n'
DEBUG:caldav:sending request - method=PROPFIND, url=https://subdomain.domain.com/dav.php/calendars/username/, headers={'User-Agent': 'python-caldav/2.1.2', 'Content-Type': 'text/xml', 'Accept': 'text/xml, text/calendar', 'Depth': '0'}
body:
<?xml version='1.0' encoding='utf-8'?>
<D:propfind xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"><D:prop><D:current-user-principal/></D:prop></D:propfind>
DEBUG:caldav:server responded with 401 Unauthorized
DEBUG:caldav:response headers: {'server': 'openresty', 'date': 'Thu, 20 Nov 2025 20:32:43 GMT', 'content-type': 'application/xml; charset=utf-8', 'expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'cache-control': 'no-store, no-cache, must-revalidate', 'pragma': 'no-cache', 'x-sabre-version': '4.7.0', 'vary': 'Brief,Prefer', 'dav': '1, 3, extended-mkcol, access-control, calendarserver-principal-property-search, calendar-access, calendar-proxy, calendar-auto-schedule, calendar-availability, resource-sharing, calendarserver-sharing, addressbook', 'www-authenticate': 'Digest realm="BaikalDAV",qop="auth",nonce="691f7aebeadab",opaque="d66d5f0524036afcb61420e358f990ce"', 'strict-transport-security': 'max-age=63072000; preload'}
DEBUG:caldav:response status: 401
DEBUG:caldav:b'<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">\n <s:sabredav-version>4.7.0</s:sabredav-version>\n <s:exception>Sabre\\DAV\\Exception\\NotAuthenticated</s:exception>\n <s:message>No \'Authorization: Digest\' header found. Either the client didn\'t send one, or the server is misconfigured. Login was needed for privilege: {DAV:}read on calendars/username</s:message>\n</d:error>\n'
DEBUG:caldav:b'<?xml version="1.0" encoding="utf-8"?>\n<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">\n <s:sabredav-version>4.7.0</s:sabredav-version>\n <s:exception>Sabre\\DAV\\Exception\\NotAuthenticated</s:exception>\n <s:message>No \'Authorization: Digest\' header found. Either the client didn\'t send one, or the server is misconfigured. Login was needed for privilege: {DAV:}read on calendars/username</s:message>\n</d:error>\n'
Traceback (most recent call last):
File "/home/username/projects/baikal_test/123.py", line 24, in <module>
principal = client.principal()
File "/home/username/projects/baikal_test/.venv/lib/python3.10/site-packages/caldav/davclient.py", line 647, in principal
self._principal = Principal(client=self, *largs, **kwargs)
File "/home/username/projects/baikal_test/.venv/lib/python3.10/site-packages/caldav/collection.py", line 235, in __init__
cup = self.get_property(dav.CurrentUserPrincipal())
File "/home/username/projects/baikal_test/.venv/lib/python3.10/site-packages/caldav/davobject.py", line 259, in get_property
foo = self.get_properties([prop], **passthrough)
File "/home/username/projects/baikal_test/.venv/lib/python3.10/site-packages/caldav/davobject.py", line 290, in get_properties
response = self._query_properties(props, depth)
File "/home/username/projects/baikal_test/.venv/lib/python3.10/site-packages/caldav/davobject.py", line 191, in _query_properties
return self._query(root, depth)
File "/home/username/projects/baikal_test/.venv/lib/python3.10/site-packages/caldav/davobject.py", line 219, in _query
ret = getattr(self.client, query_method)(url, body, depth)
File "/home/username/projects/baikal_test/.venv/lib/python3.10/site-packages/caldav/davclient.py", line 711, in propfind
return self.request(
File "/home/username/projects/baikal_test/.venv/lib/python3.10/site-packages/caldav/davclient.py", line 987, in request
return self.request(str(url_obj), method, body, headers)
File "/home/username/projects/baikal_test/.venv/lib/python3.10/site-packages/caldav/davclient.py", line 1029, in request
raise error.AuthorizationError(url=str(url_obj), reason=reason)
caldav.lib.error.AuthorizationError: AuthorizationError at 'https://subdomain.domain.com/dav.php/calendars/username/', reason Unauthorized
Metadata
Metadata
Assignees
Labels
need-feedbackNothing will be done without more info/feedback from someone that can reproduce the issueNothing will be done without more info/feedback from someone that can reproduce the issue