REPORT request and iCal Server
Hello, I'm trying to talk to iCal Server from a WebObjects app with CalDAV4J (Java API from the Chandler Project). I can connect and get a specific calendar, but I'm trying to do a REPORT request: REPORT /calendars/users/diradmin/calendar/ HTTP/1.1 and I'm getting a 401 HTTP error: HTTP/1.1 401 Unauthorized WWW-Authenticate: digest nonce="174385117913098369521756197356", realm="/Search", algorithm="md5" In the Chandler examples, they are querying "/cosmo/dav/test/ collection", so I guess I'm not querying the good thing or I don't understand the REPORT query. What is the correct URL for a REPORT query ? Thanks.
On 26.10.2007, at 21:42, Pascal Robert wrote:
I'm trying to talk to iCal Server from a WebObjects app with CalDAV4J (Java API from the Chandler Project). I can connect and get a specific calendar, but I'm trying to do a REPORT request:
REPORT /calendars/users/diradmin/calendar/ HTTP/1.1
and I'm getting a 401 HTTP error:
HTTP/1.1 401 Unauthorized WWW-Authenticate: digest nonce="174385117913098369521756197356", realm="/Search", algorithm="md5"
In the Chandler examples, they are querying "/cosmo/dav/test/ collection", so I guess I'm not querying the good thing or I don't understand the REPORT query. What is the correct URL for a REPORT query ?
The URL just fine. The 401 response just means that you need to provide a username/password (should be pretty obvious ;-). Apparently CalDAV4J uses org.apache.commons.httpclient, which probably has the necessary hooks to deal with authentication. Greets, Helge -- http://www.helgehess.eu/
Hi Pascal, --On October 26, 2007 3:42:20 PM -0400 Pascal Robert <probert@os.ca> wrote:
I'm trying to talk to iCal Server from a WebObjects app with CalDAV4J (Java API from the Chandler Project). I can connect and get a specific calendar, but I'm trying to do a REPORT request:
REPORT /calendars/users/diradmin/calendar/ HTTP/1.1
and I'm getting a 401 HTTP error:
HTTP/1.1 401 Unauthorized WWW-Authenticate: digest nonce="174385117913098369521756197356", realm="/Search", algorithm="md5"
In the Chandler examples, they are querying "/cosmo/dav/test/collection", so I guess I'm not querying the good thing or I don't understand the REPORT query. What is the correct URL for a REPORT query ?
Actually the error is caused by you trying to access a protected resource without authentication. The server is responding with the proper 401 code plus a WWW-Authenticate header that should trigger your client library to authenticate. Perhaps CalDAV4J does not support digest authentication, which is the only one being advertised by the server? If so, you will need to manually edit the server's caldavd.plist configuration file and enable Basic authentication (which I am guessing CalDAV4J does support). -- Cyrus Daboo
Le 07-10-26 à 16:15, Cyrus Daboo a écrit :
Hi Pascal,
--On October 26, 2007 3:42:20 PM -0400 Pascal Robert <probert@os.ca> wrote:
I'm trying to talk to iCal Server from a WebObjects app with CalDAV4J (Java API from the Chandler Project). I can connect and get a specific calendar, but I'm trying to do a REPORT request:
REPORT /calendars/users/diradmin/calendar/ HTTP/1.1
and I'm getting a 401 HTTP error:
HTTP/1.1 401 Unauthorized WWW-Authenticate: digest nonce="174385117913098369521756197356", realm="/Search", algorithm="md5"
In the Chandler examples, they are querying "/cosmo/dav/test/ collection", so I guess I'm not querying the good thing or I don't understand the REPORT query. What is the correct URL for a REPORT query ?
Actually the error is caused by you trying to access a protected resource without authentication. The server is responding with the proper 401 code plus a WWW-Authenticate header that should trigger your client library to authenticate.
Perhaps CalDAV4J does not support digest authentication, which is the only one being advertised by the server? If so, you will need to manually edit the server's caldavd.plist configuration file and enable Basic authentication (which I am guessing CalDAV4J does support).
Ok, I was able to get Digest working by setting setDoAuthentification, but it seems CalDAV4J is having problem with the REPORT request : 192.168.003.143.60372-192.168.003.015.08008: REPORT /calendars/users/ diradmin/calendar/ HTTP/1.1 User-Agent: Jakarta Commons-HttpClient/3.1 Authorization: Digest username="diradmin", realm="/Search", nonce="2006034310142261744877882846", uri="/calendars/users/diradmin/ calendar/", response="e5b06f489602e85901f27c4b1d5ac4d5", algorithm="md5" Host: g3test.os.lan:8008 Depth: 1 And I get a 400 error code, because the actual request is not complete. I should see something like this in the request ? <?xml version="1.0"?> <C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav"> <D:prop xmlns:D="DAV:"> <C:calendar-data/> </D:prop> <C:filter> <C:comp-filter name="VCALENDAR"> <C:comp-filter name="VEVENT"> <C:time-range start="20060101T000000Z" end="20060107T000000Z"/> </C:comp-filter> </C:comp-filter> </C:filter> </C:calendar-query>
participants (3)
-
Cyrus Daboo
-
Helge Heß
-
Pascal Robert