Conversation
|
Nice! So whats the server path i have to configure my carddav Client with? Just the radicale host returns 'user not authenticated' |
|
this depends on your client, which collection discovery method is used. radicale organizes collections and items like the following way: using '/base_prefix/user-principal/' as server path should work in most cases. the authentication issues should be fixed in the second commit 66e38bd |
|
Thanks, well ok, that's exactly what I did - tested with latest apple clients, on iOS and Mavericks using DB as radicale backend - auth issues still remain :( |
|
Thanks a lot for your work, the code is clean, that's really nice! A couple of questions before merging:
Thanks again! |
|
@rngtng |
|
With this branch. With master auth works, but addressbook/contacts |
|
@liZe the security problem: about the compatibility: by the way, there is an other PROPFIND tag which is not RFC compliant
|
|
@rngtng |
|
@chripo thx for ur test server - strange this worked for me.. What auth method and Backend do you use? Sure will provide logs soonish... Thanks!!! |
|
acal on android is able to discover the principal and all calendars. the path dosen't matter.
|
|
@rngtng |
|
Interesting ... So maybe DB backend is the problem. Will check asap I'm |
|
@liZe
<response>
<href>/test/test/</href>
<propstat>
<prop>
<current-user-principal>
<href>/test/calendar.ics/</href>
</current-user-principal>
<principal-URL>
<href>/test/test/</href>
</principal-URL>
<displayname>test</displayname>
<C:calendar-home-set>
<href>/test/test/</href>
</C:calendar-home-set>
<principal-collection-set>
<href>/test/test/</href>
</principal-collection-set>
</prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>using skipping the principal discovery request and start over with a PROPFIND + DEPTH=1 on the for this reason this patchset will get some broken clients to discover your collections fully. plus it will give rfc complaint clients to discover and access all your collections. use this curl query and play with the path to reproduce the collection discovery: curl -i -X PROPFIND -d '<?xml version="1.0" encoding="UTF-8"?><N0:propfind xmlns:N0="DAV:" xmlns:N1="urn:ietf:params:xml:ns:caldav"><N0:prop><N0:current-user-principal /><N0:principal-URL /><N0:displayname /><N1:calendar-home-set /><N0:principal-collection-set/></N0:prop></N0:propfind>' -u 'USER:PASSWORD' RADICALE_SERVICE_URL |
|
@chripo tested with Mac OS X contacts client, seems to work as well :) Next, I'll check my DB setup and check there.. |
|
@chripo wanted to test with carddavmate, but your server returns headers: I guess its case sensitive, so can u please update this to |
|
@chripo btw.: tested with Mac OS X calendar - worked nice as well. Only Reminders (Tasks) failed when moving task from one Group to another, but I guess this is a feature not supported by Radicale (yet) |
|
@rngtng from RFC2616, pg. 30. "Field names are case-insensitive." so it shouldn't be an issue. anyway i changed it to case sensitive. pls give it a new try. i think the connect issue is related to the wildcard in added to my .htaccess |
|
@chripo hm true, wasn't the problem - carddavemate still doesn't work, See JS output here, but I guess its a config or browser (chrome) issue. Not sure if Carddav supports the easy connect at all. Anyway to get back to the original auth problem. See the log of my local radicale here - Maybe its a problem when the |
|
@rngtng i think the carddavmate issues are CORS related. i added some headers, pls give it another try. i created a second account without collections: user: test2 password: test2
something is wrong with your test setup or data. there is a false |
|
i couldn't get work caldavzap/carddavmate from a foreign origin, because of some therefore i set it up on a same origin as radicale and it worked like a charm. it uses "easy connect" to discover collections. |
|
@chripo thanks. I tried to connect as |
|
@rngtng you can't create entities because of there is no addressbook, i removed all collections. now i have created a few. feel free to edit the resources. curl is your friend. ~ » curl -X GET https://pim.christoph-polcin.com/test/my-addressbook-3.vcf/ -u 'test:test'
~ » curl -X DELETE https://pim.christoph-polcin.com/test/my-addressbook-3.vcf/ -u 'test:test' |
|
i will remove my last commit (locating services with help of .well-known URIs (rfc6764)) because the implementation is not correct and could be done by the frontend server. |
|
@chripo I did some more testing on my server and I guess its a problem with authorization:
Anythings wrong with my setup & config ? The client talks diretly to the radicale server. Do you have any other server in between? how come you can use |
|
@chripo Good News: it works! I started once again from a clean setup (client, server + DB) and suddenly it works perfectly. I'm confused. Anyway 👍 for latest Mac clients |
|
the anonymous user requests are related to the HTTP specs, or security best practice. the client will offer credentials with each second request if the anonymous request fails with a 401 and WWW-Authenticate header. (configurable by eg. i think your configuration / setup is messed up some how. the configfile seems to be ok, maybe start over with a fresh one and try the file backend first, it's a much simpler setup and time-proven ;) you running a different version, the log files dosen't match this branch log output!!! there is one case that could be cause an (this) issues. i'll do a test tomorrow. try some simple curl requests. ~ ? curl https://foo.christoph-polcin.com/ -X PROPFIND -H 'Depth: 0' -i
HTTP/1.1 401 Unauthorized
Date: Tue, 14 Jan 2014 20:07:44 GMT
Server: WSGIServer/0.1 Python/2.7.3
WWW-Authenticate: Basic realm="Radicale - Password Required"
Content-Length: 0
Cache-Control: max-age=0
Expires: Tue, 14 Jan 2014 20:07:44 GMT
Vary: Accept-Encoding
Connection: close
Content-Type: httpd/unix-directory
~ ? curl https://foo.christoph-polcin.com/test/ -X PROPFIND -H 'Depth: 0' -i
HTTP/1.1 401 Unauthorized
Date: Tue, 14 Jan 2014 20:07:50 GMT
Server: WSGIServer/0.1 Python/2.7.3
WWW-Authenticate: Basic realm="Radicale - Password Required"
Content-Length: 0
Cache-Control: max-age=0
Expires: Tue, 14 Jan 2014 20:07:50 GMT
Vary: Accept-Encoding
Connection: close
Content-Type: application/octet-stream
~ ? curl https://foo.christoph-polcin.com/test/test/ -X PROPFIND -H 'Depth: 0' -i
HTTP/1.1 401 Unauthorized
Date: Tue, 14 Jan 2014 20:07:55 GMT
Server: WSGIServer/0.1 Python/2.7.3
WWW-Authenticate: Basic realm="Radicale - Password Required"
Content-Length: 0
Cache-Control: max-age=0
Expires: Tue, 14 Jan 2014 20:07:55 GMT
Vary: Accept-Encoding
Connection: close
Content-Type: application/octet-stream
~ ? curl https://foo.christoph-polcin.com/test/test/ -X PROPFIND -H 'Depth: 0' -i -u 'test:test'
HTTP/1.1 207 Unknown
Date: Tue, 14 Jan 2014 20:08:05 GMT
Server: WSGIServer/0.1 Python/2.7.3
DAV: 1, 2, 3, calendar-access, addressbook, extended-mkcol
Content-Type: text/xml
Content-Length: 845
Cache-Control: max-age=0
Expires: Tue, 14 Jan 2014 20:08:05 GMT
Vary: Accept-Encoding
Connection: close
<?xml version="1.0"?>
<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:CS="http://calendarserver.org/ns/" xmlns:ICAL="http://apple.com/ns/ical/">
<response>
<href>/test/test/</href>
<propstat>
<prop>
<getcontenttype>text/calendar</getcontenttype>
<resourcetype>
<C:calendar />
<collection />
</resourcetype>
<displayname>test</displayname>
<owner>/test/</owner>
<getetag>"d41d8cd98f00b204e9800998ecf8427e"</getetag>
<current-user-principal>
<href>/test/</href>
</current-user-principal>
<ICAL:calendar-color>#781d32</ICAL:calendar-color>
<CS:getctag>"d41d8cd98f00b204e9800998ecf8427e"</CS:getctag>
</prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
</multistatus>
~ ? curl https://foo.christoph-polcin.com/ -X PROPFIND -H 'Depth: 0' -i -u 'test:test'
HTTP/1.1 207 Unknown
Date: Tue, 14 Jan 2014 20:09:39 GMT
Server: WSGIServer/0.1 Python/2.7.3
DAV: 1, 2, 3, calendar-access, addressbook, extended-mkcol
Content-Type: text/xml
Content-Length: 657
Cache-Control: max-age=0
Expires: Tue, 14 Jan 2014 20:09:39 GMT
Vary: Accept-Encoding
Connection: close
<?xml version="1.0"?>
<multistatus xmlns="DAV:" xmlns:CS="http://calendarserver.org/ns/" xmlns:ICAL="http://apple.com/ns/ical/">
<response>
<href>/</href>
<propstat>
<prop>
<resourcetype />
<current-user-principal>
<href>/test/</href>
</current-user-principal>
</prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getcontenttype />
<displayname />
<owner />
<getetag />
<ICAL:calendar-color />
<CS:getctag />
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
</multistatus>
~ ? curl https://foo.christoph-polcin.com/ -X PROPFIND --data '<?xml version="1.0" encoding="UTF-8"?><A:propfind xmlns:A="DAV:"><A:prop><A:current-user-principal/><A:principal-URL/></A:prop></A:propfind>' -H 'Depth: 0' -i -u 'test:test'
HTTP/1.1 207 Unknown
Date: Tue, 14 Jan 2014 20:15:08 GMT
Server: WSGIServer/0.1 Python/2.7.3
DAV: 1, 2, 3, calendar-access, addressbook, extended-mkcol
Content-Type: text/xml
Content-Length: 383
Cache-Control: max-age=0
Expires: Tue, 14 Jan 2014 20:15:08 GMT
Vary: Accept-Encoding
Connection: close
<?xml version="1.0"?>
<multistatus xmlns="DAV:">
<response>
<href>/</href>
<propstat>
<prop>
<current-user-principal>
<href>/test/</href>
</current-user-principal>
<principal-URL>
<href>/test/</href>
</principal-URL>
</prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
</multistatus> |
under certain conditions it was possible to pass the final access control
if-clause. the master branch grants access if:
if ((read_allowed_items or write_allowed_items)
and (not user or auth.is_authenticated(user, password))) or \
function == self.options or not items:
the easy-connect branch from pull request Kozea#95 extends it with:
(is_authenticated and function == self.propfind) or
the last `or not items` condition levers out the previous authentication and
access control. that isn't that big secuity issue because in this case there
are no collection and items at all. but "bad" and anonymous users could gather
data and information which not destined for them.
this commit fixes and simplifies the if-clause.
under certain conditions it was possible to pass the final access control
if-clause. the master branch grants access if:
if ((read_allowed_items or write_allowed_items)
and (not user or auth.is_authenticated(user, password))) or \
function == self.options or not items:
the easy-connect branch from pull request Kozea#95 extends it with:
(is_authenticated and function == self.propfind) or
the last `or not items` condition levers out the previous authentication and
access control. that isn't that big secuity issue because in this case there
are no collection and items at all. but "bad" and anonymous users could gather
data and information which not destined for them.
this commit fixes and simplifies the if-clause.
under certain conditions it was possible to pass the final access control
if-clause. the master branch grants access if:
if ((read_allowed_items or write_allowed_items)
and (not user or auth.is_authenticated(user, password))) or \
function == self.options or not items:
the easy-connect branch from pull request Kozea#95 extends it with:
(is_authenticated and function == self.propfind) or
the last `or not items` condition levers out the previous authentication and
access control. that isn't that big secuity issue because in this case there
are no collection and items at all. but "bad" and anonymous users could gather
data and information which not destined for them.
this commit fixes and simplifies the if-clause.
|
fix some path issues for the last commit (Fix calendar/addressbook-home-set in PROPFIND response) if the base_prefix is set to something else then '/' we did some test with davdroid too. collection discovery succeeded. |
under certain conditions it was possible to pass the final access control
if-clause. the master branch granted access if:
if ((read_allowed_items or write_allowed_items)
and (not user or auth.is_authenticated(user, password))) or
function == self.options or not items:
the easy-connect branch from pull request Kozea#95 adds:
(is_authenticated and function == self.propfind) or
the last `or not items` condition levers out the previous authentication and
access control. that isn't that big secuity issue because in this case there
are no collection and items at all. but "bad" and anonymous users could gather
data and information which not destined for them.
this commit fixes and simplifies the if-clause.
|
fixed a path issue. hopefully the last one ;) |
|
Cool thanks. 👍 |
|
I can confirm this version is working for me - my setup is as follows:
I tested this on an android device with davdroid and I'm now able to sync calendars and addressbooks. |
|
The code is clean, everybody is happy, time to merge! |
|
As this feature has broken support of Apple clients (see #111 and maybe #110), I've decided to revert the commits of this pull request (see #189) to release a 0.9 version soon. Please open a new pull request with this code and the fixes for Apple clients, I'll merge it for 1.0. That's sad, because this feature is really useful, but I can't fix the bugs with Apple clients. I'm really sorry, but we can't be stuck at 0.9b1 waiting for a solution. I hope that someone will be interested enough to test these clients and find a solution. |
all changes are related to the PROPFIND request / response.
now it is possible to connect and retrieve your collections by
the specs taken from rfc4791 and rfc5397.
this fixes are required to get the firefox-os calendar app working.