How to sync ICloud Calendar?

42,921

Solution 1

The answer by the OP is very useful but it's missing some key pieces. In particular how to determine the complete caldav URL by substituting the XXXX above.

Credit for my answer is due to this blog post (note: I use Thunderbird/Lightning as my caldav client but this is irrelevant) .

The format of an iCloud caldav URL is as follows:

https://pXX-caldav.icloud.com/<DSid>/calendars/<pGUID>

To determine the relevant parameters, first logon to your account on icloud.com, then launch the Firefox web debugging console (F12). The steps are depicted on the below screenshots which show the web debugging console below the iCloud calendar page. With the "Network" tab selected -step (1)- generate some traffic against desired calendars (eg: create a dummy appointment). Look for the corresponding POST (or GET) interactions.

  • The DSid parameter is some sort of numeric userID so it will be the same for multiple calendars/tasklists owned by the same account. Flip to "Parameters" -steps (2) & (3)- to reveal it. Determining 'dsid'
  • The pGUID varies from calendar to calendar (it could simply be "Home" or "tasks" if you don't have multiple calendars/tasklists setup). It can be peeked from the same interactions, but using the "Response" tab -steps (4) & (5)- You may have to drill down in the JSON structures a little to discover it. Determining 'pGUID'

That's all well and good. However it all stopped working quite recently and the comments at the bottom of the aforementioned blog post thankfully pointed to the source of the issue: since June 2017 Apple is migrating iCloud accounts to enforce app-specific passwords as a very sensible security measure. This means it's no longer possible to just use the main iCloud password for authentication when syncing calendars.

Once migration has happened to your iCloud account (you'll notice your calendar sync fails) the following steps are required:

  1. Enable 2-factor authentication on your iCloud account
  2. Generate an app-specific password and use that in your caldav client
  3. It's quite likely your caldav server will have changed as part of the migration (mine went from p03 to p40) so URLs need adjusting.

This news item (in German, use Google translate if necessary) has the background info on app-specific passwords.

BTW: I don't think calendars have to be shared in order to be accessed in this way.

Solution 2

Here's a 2018 Update. If you want to use your iCloud calendar in Gnome Calendar you still need to install Evolution. After you added the calendar, you can remove Evolution.

  • Go to icloud.com and temporarily share a calendar to get the server URL and note it down somewhere (e.g. https://p12-caldav.icloud.com). Now deactivate the calendar sharing. If you don't do this, everyone can view this shared calendar!
  • Log into your Apple account and create an application-specific password for Evolution to access the calendars.
  • In Evolution create a new calendar, select CalDAV and enter the Server URL. Do not enter the full calendar URL, only the domain part (e.g. https://p12-caldav.icloud.com).
  • For the user enter your AppleId-Email and click find calendars. You will now be asked the password you created earlier (save it) and can select as many calendars as you like to be synced.

Solution 3

To sync your ICloud calendars you will need a calendar client that supports CalDAV, e.g. Evolution, which is the one I will show, as it automatically displays the same content on Ubuntu's default calendar.

1. Download Evolution mail/calendar client:

Install it from Software Center:

Evolution on Software Center

or run sudo apt install evolution.

2. Open icloud.com in a web browser and go to your calendars. Click on the circular wireless icon to the right of the name of the calendar you want to use.

ICloud share icon

The calendar you want to use must be shared (dark icon). If it's not, you'll be presented with the option there.

3. Once the calendar is shared, note the name of the server right after webcal:// (example: p02-www.icloud.com)

4. Open Evolution:

  • File > New... > Calendar

Configure it as:

Type: CalDAV

Enable Copy calendar contents locally... to acces it offline.

URL: If the server was p02-www.icloud.com/abc/123, you would replace www with caldav and enter p02-caldav.icloud.com/abc/123. And it should always look like http://pXX... , not like http://webcal://pXX...

User: [email protected]

enter image description here

5. Click on Find Calendars, enter your ICloud password and select whichever calendar you want to sync.

6. If you want to sync more than one calendar, just repeat from step 3 in advance.


Now your ICloud calendars will appear on Calendar and you will get a preview on the top panel calendar indicator

enter image description here

Solution 4

Mandatory for it to work You should also go to the address below, then to the Security tab, passwords for applications. Type Evolution in the field, then copy the generated code and paste it into evolution in the requested password.

https://appleid.apple.com

Share:
42,921

Related videos on Youtube

M. Becerra
Author by

M. Becerra

Updated on September 18, 2022

Comments

  • M. Becerra
    M. Becerra over 1 year

    I want to be able to acces the calendars I have on my ICloud account without having to use a web-browser, and possibly offline.

    How can I sync my calendars from ICloud with some calendar client on Ubuntu?

  • John Mee
    John Mee about 5 years
    For authentication in step 4, you have to log into appleid.apple.com and generate an application specific password for every calendar you want to access. (The 'user' doesn't have to be an icloud email address.)
  • Matt Hough
    Matt Hough over 3 years
    And the name of the application for the 'application specific password' should be 'Evolution'. See @Jerome Villiseck's answer.
  • askielboe
    askielboe about 3 years
    This worked perfectly, thank you. No need to inspect the network requests like the other answer suggests.