CalDAV-Calendar: How to add iCloud-Calendar successfully?

The whole afternoon I tried to add an iCloud calendar in Sailfish OS 5.1.0.11 without luck.

In my Apple account I have set an app-specific password that is necessary in order to grant access for third-party apps to use the Apple ecosystem.

So in Thunderbird I just added this calendar as a remote network calendar with the URL https://caldav.icloud.com. Thunderbird automatically takes care of the rest and transforms this URL to https://p40-caldav.icloud.com/user-id/calendar while detecting all available calendars automatically. Each detected calendar is then added with an own URL in this logic: https://p40-caldav.icloud.com/user-id/calendar/cryptic-calendar-id and works like a charm.

However, in Sailfish OS 5.1.0.11 this does not work. I tried several different URLs, like:

None of the above URLs work properly. I always receive this error

Account error
Could not create account

Check sign-in details and try again.
Authentication failed for URL: https://p40-caldav.icloud.com/.well-known

I don’t know what else to do. Do you have any tipps how I can make this work?

Can you try this?

or this?

I also found the following which should help finding the right user id values:

Or this:

https://discussions.apple.com/thread/254109162

Thank you very much for your help!

Unfortunately the first two screenshots didn’t help either. The WebDAV path will automatically get adjusted once tapping “Accept’”, so the whole part of the https:// segment will be missing then.

I will have a look at the GitHub link tomorrow! :grinning_face:

I’m not sure if that’s the solution? In my case, two ‘links’ have been generated in Thunderbird for contacts and appointments. Try setting up contacts and appointments separately.

caldav.icloud.com

contacts.icloud.com

I’ve only set up email myself at the moment. But I could test it tomorrow with the new Jolla 5.2 if needed. I hope that helps.

It would be very kind if you could test it with the new Jolla 5.2. Does this work?

Hi, sorry for the late reply.
When I first set up my iCloud account, there was an option to synchronise contacts and calendars alongside my email, but I deselected it as I don’t have any calendars or contacts on Apple or Gmail.
I then tried today to synchronise the calendar and contacts, one at a time.
carddav.icloud.com worked straight away, but caldav.icloud.com didn’t.
I then deleted the email account and created a new one; the ‘Calendar and Contacts’ option no longer appeared.
To rule out any interaction with the Thunderbird account, I generated a new app password in my Apple ID.
I haven’t managed to sort out the calendar yet; to verify it, I’d need to create some sample data.
That’s the current situation.

Hi, I have very similar issues.

I have an app-specific password for caldav in my icloud account.

When I set that password and my appleid in the caldav account setup on my phone, I get the following results:

I cannot get any calendars however.

With no path in the calendar path option, the log (devel-su journalctl -b -f) reports that the phone has asked for the user principal url and it logs the reply, which is that there is a protocol error.

With a path in the calendar path, the log shows that valid xml was received in the reply but also that there were no calendars.

I can easily connect from Evolution on my desktop machine (linux mint).

I can see the path that Evolution is using. I have tried various parts of that path, starting with ‘/’, then ‘/[id]/’, then ‘/[id/calendars/’, then ‘/[id]/calendars/home/’. All report valid xml but no calendars.

Xperia 10 III 5.1.0.11.

Any advice or suggestion will be very gratefully received.

John

This might help you with troubleshooting.

Many thanks. The dav-client tool with debugging turned on gave me a hint:

…
QNAM: network session changed prevented from “wifi access point” to “Lebara” as WLAN access point already online.
…

So I turned the WLAN connection off, so the phone was using the mobile data connection only, and tried the account again and it worked fine.

I’m glad the tip from @dcaliste helped you.
Let’s see if this also solves the problem for @Picanha.
If so, @dcaliste could mark the thread as resolved.

Thank you for that hint! :heart_eyes:

So you basically just added a new CalDAV/CardDAV-Account and used the following input data:

Username: Your Apple-Username
Password: The “app-specific” password

Server: https://caldav.icloud.com (http or https?)

Paths: Empty

And all this while mobile data is turned on, WiFi is turned off?


Update: When using http://caldav.icloud.com (no https) I get the error

Account error

Could not create account

The network request was unsuccessful

And when using https://caldav.icloud.com (https) I get

Account error

Could not create account

Check sign-in detaisl and try again.

Authentication failed for URL: https://caldav.icloud.co/.well-known

Everything has been tested on mobile data…

Could you retry the https:// case, unchecking credential verification on creation ?

This may be related to this issue : CalDAV / CardDAV not working - #52 by dcaliste

Welcome! Yes, that is what I did. Server https.

Your quoted error message shows the caldav icloud URL as ending “.co”, not “.com” ?

I’ve found a solution: simply add the iCal calendar as a CalDAV feed in Apple Calendar. Then, under the account settings, you’ll see the key details such as your user number, and the correct ‘p’ number will appear as soon as you log in for the first time – you’ll need to put this before https://pxx-caldav.com. For me, it looks like this: https://p177-caldav.icloud.com, with ‘Ignore SSL errors’ enabled. It’s important to include the following in the calendar path: /your number(xxxxxxxxx)/calendars/. Good luck! I’m delighted that everything’s working perfectly now :slight_smile:

Works fine for iCloud calendars and contacts!

  1. Check your server number (pxx) and your user number (xxxxxxxx) for example with Thunderbird. There you find the correct information you need to set up your icloud contacts and calendars on a Jolla 2026.
  2. Turn off Wifi, no idea if this helps :wink:
  3. Use your Apple Login ID (email) but with an app specific password which you can create on your Apple account page. Don‘t forget that you need two of them, the first one is used by Thunderbird already
  4. Server: https://pxx-caldav.icloud.com (Separate account for carddav)
  5. Ignore SSL error
  6. No authentication during setup
  7. Path to calendar: /xxxxxxxxxx/calendars/ (contacts for carddav)

Hmmm… I try to find pxxx id but I don’t find it somehow. Could you show the place in iCloud settings?

You have to check these numbers in a third party application like Thunderbird. When you set up your calendars and contact there, you just have to enter your User ID, Password and Server without any additional information. As a result after connecting successfully you can see the proper server name (pxx-caldav…) and your user ID (xxxxxx) when you look it up in the properties of Thunderbird

@Picanha I can confirm that this works. Do not forget to add the path to the calendar (the separate field, at the bottom of the screen). Just like @Maoam described: /xxxxxxxxxx/calendars/

thatiś it

If useful to anyone I followed a different process. The above did not work always had auth error.

Following the hint of (useful for once) Apple discussions forum post “Finding iCal CalDav Server Settings” on my Mac found the PrincipalURL value in the form of https://p<number>-caldav.icloud.com/<user ID>/principal/ and the DefaultCalendarPath value in the form of /<user ID>/calendars/<calendar ID>/. Joining them as https://p<number>-caldav.icloud.com/<user ID/calendars/<calendar ID>/ .

In the add CalDAV dialog Username and Passowrd as described by @Maoam, Server address as above and - key to success for me - Authenticate during account creation disabled.

Account was created and after multiple sync I now have the list of calendars available and the events themselves.

Different route perhaps because trialing v4.4 on an oldie.

That worked for me as well (almost)! :star_struck:

My Calendars sync like a charm, but my contacts won’t update. Is there anywhere I can trace this?