7

For a calendar application, I want to know of 3rd party calendar event changes. For example, a user adds an iCal/Google calendar into my app. My app should be notified of changes to events. After some research, it seems CalDAV is the way to do it. But I don't fully understand how the app should work.

So my understanding so far: I will have my server act as a CalDAV client. Users will provide login credentials to my app to get data from their calendars? I have 2 concerns: Security and Performance (how to sync)

Security

This sounds like it works, but isit it very unsecure (since I will have to provide my login credentials to some untrusted server)? It seems like OAuth should be used instead? Is there something I am not understanding correctly?

How to sync and performance

I want to be notified of calendar changes (for example, if a user updates the Google Calendar). Something similar to webhooks should be the best. But is there such a thing? When I look at a package dav in NPM, seems like its all pull based. If I have to constantly poll for changes, it might be very inefficient?

I intend to build the server using NodeJS

Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
  • hi Jiew, i'm interested in your progression if you have some feedbacks to share! – mlb Feb 08 '16 at 17:57
  • 1
    @mlb, for now we decided not to use CalDav and rely on App to provide calendar data from iOS/EventKit. For research, I managed to get event infos, but not edit/delete. It appears iCloud CalDav is returning 403 for those requests – Jiew Meng Feb 10 '16 at 00:36
  • @JiewMeng Sadly, I have nothing nice to say about Apple with regards to them not playing well with others... – Michael Jul 25 '17 at 15:09
  • 1
    Has there been some development for this 5 years later? Looking for a CalDav solution that supports webhooks on event changes. – Daniel Apr 08 '21 at 13:22

1 Answers1

6

Wrt security, you are right. For many (the majority of) CalDAV servers you would need to store the users credentials (usually Basic or Digest authentication is used). Which is bad. Though some servers, like the Google CalDAV API, support (or even require) OAuth.

Wrt to push, you are right again. There is no standard for push in DAV yet. Some servers do push, like iCloud or the Apple CalendarServer, but they do so using proprietary protocols which won't help your use case. So yes, you very likely have to poll (make sure to use sync-reports to make that efficient). Though the poll request required isn't too expensive and can be run often.

In short: your analysis is right. CalDAV in its current incarnation is primarily targeted at pure client-server interaction and has deficiencies for your application. Though it is still the best choice you have :-)

hnh
  • 13,957
  • 6
  • 30
  • 40