core: iCloud integration stopped working (due to Apple SRP-6a implementation)

The problem

The iCloud integration fix recently merged to support App Passwords relies on a one-time login with the ‘regular’ password and MFA prompt. However, Apple has updated their side and now require Secure Remote Password protocol which is currently not supported by PyiCloud. As a result the iCloud integration no longer works. BTW, it is already reported in the PyiCloud repo.

I opened this issue because the App Password issue was closed when the mentioned fix was merged.

What version of Home Assistant Core has the issue?

core-2024.10.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

iCloud

Link to integration documentation on our website

https://www.home-assistant.io/integrations/icloud

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 224
  • Comments: 147 (10 by maintainers)

Most upvoted comments

A reminder to everyone that GitHub does have a “subscribe” feature you can use to follow this issue, and if you add a 👍 to the original post there’ll be an easy count of people experiencing the same issue 😄

follow

@timlaing Thank you for your hard work, fixing the Auth issues…

I have had the lastest pyicloud running for the last couple of days with no issues.

Please note there is no app-specific password support yet.

icloud_2.0.7.zip

@PaulCavill - I am attempting to get app specific passwords to work by using tokens from CardDav/CalDav services. Hopefully I will be able to get this working and give an update soon.

I have a working version via custom_component, @Quentame @nzapponi

icloud.zip

Still looking at it, however there maybe an error in the logic handling a password failure when re-authenticating after a session expires. I am working on a fix for this issue and will have it ready soon.

We first have to make contact with the maintainers of the pyiCloud project to get this solved.

There has been a PR submitted already that contains a fix, just need the maintainers to approve and deployed.

I have emailed one of the maintainers, Just waiting for a response currently.

pyicloud is out of maintainance for 3 years. maybe this project should be ported to pyicloud-pd. pyicloud-pd implemented SRP login 4 months ago.

You can add the folder / files to the custom_components folder in your config directory.

image

still no working in latest HA update

I have just created the new release of pyicloud.

@WollfWizard new maintainer has a preview release im currently testing, and is seem to be working. Pending take over of the pypi project,

A new maintainer of https://pypi.org/project/pyicloud/ has made a request to take over the project, pending approval.

https://github.com/pypi/support/issues/5377

To avoid excessive notifications for everyone subscribed, please do not comment if you have the same issue. The owner is already informed. Instead, consider liking the original post and subscribing to updates.

I have managed to address some of authentication logic issues, which ment that it’s was always reverting to full authentication rather than using the stored tokens. I have been testing that for a few days to make sure that this doesn’t cause account lockouts.

With regards to app passwords - apple have definitely locked this down more, however I am in the middle of trying to see if I can use the apple photos login chains to allow renewal of the token with a app password.

According to the Apple official documentation they only support app passwords for Mail/Calendar/Contacts which is disappointing for us.

Thank you @paullenhardt for confirming App-Specific password are working in @timlaing repo, I have update the HA custom component, by adding in https://github.com/timlaing/pyicloud main branch.

Once @timlaing takes over the pypi package the exising HA core Intergration should work with no changes

icloud_6.zip

Ref: https://github.com/timlaing/pyicloud/issues/26

It’s good to know that there is a workaround. But is there already something done do work on a fix for this integration? I think for most users it would be the best solution go get this integration back to working with the next HA release.

I too am having this issue.

Whilst I know it is being worked on, is there a workaround as I have automations that rely on my Iphone and they do not currently work.

having this issue as well - following

@WollfWizard I have been doing this from the off. However, I will regularly now receive an alert from Apple to say my ID has been signed in to on a web browser. Obviously I can put up with that, but it would mean that I am not as aware about a “true” security breach on my profile since I will likely assume it is just from this integration. Having the app-specific passwords back up and running would negate this. I have experienced similar issues on the CalDav integration for apple calendars as well.

It started again for me just a few days ago. I don’t get the six digit code from Apple to finish signing in with the app specific password.

Sadly, not for me: image

A new maintainer of https://pypi.org/project/pyicloud/ has made a request to take over the project, pending approval.

pypi/support#5377

If I read that correctly, the new maintainer has a fork of pyicloud which already has a fix for the authentication issue. Wouldn’t it be possible to use this fork? That should enable us to use app specific passwords again, right?

Check the fix for pyicloud at https://github.com/picklepete/pyicloud/issues/456

for base.py

👍

Same error! IMG_4239

I have push the PR for review.

I guess this wasn’t pushed to 2025.06.2 ?

https://github.com/home-assistant/core/pull/129059#issuecomment-2979611909

I have push the PR for review.

Are you able to link us to it so we can see if it gets approved and what version it will be working on?

https://github.com/home-assistant/core/pull/129059

Thought I’d give this another go just incase the last few updates have changed this but no success. Still getting this: Image after putting in App Specific Password but nothing pops up on my devices.

@Quentame @nzapponi - any word if we will get an update for this?

@timlaing Thank you for your hard work, fixing the Auth issues…

I have had the lastest pyicloud running for the last couple of days with no issues.

Please note there is no app-specific password support yet.

icloud_2.0.7.zip

cher @Quentame peux-tu faire qqchose pour cela stp ?

First login requires your main password as per normal for setting up this integration. The new optional flow should allow you to update the password to app-specific password

@gorbunovav found the issue. Fix in the below zip.

@rcmaehl can you test out addng app-specific password.

icloud_5.zip

app-specific password flow

  • In the integration screen the “configure” option will now show
  • Tick the “reauthenticate” box and click submit
  • refresh browser page
  • click reconfigure option
  • key in app-specfic password and click submit

@PaulCavill I am getting

File “/usr/local/lib/python3.13/site-packages/pyicloudng/base.py”, line 239, in init raise NotImplementedError(f"Domain ‘{domain}’ is not supported yet") NotImplementedError: Domain ‘/config/.storage/icloud’ is not supported yet

after submitting credentials in the first step of the add integration form. Home Assistant version - 2025.1.4

Pending take over of the pypi project,

Did you want to write more here? Can I install the preview directly in HA?

with normal pwd it working for me… with specifica pwd not…

It started again for me just a few days ago. I don’t get the six digit code from Apple to finish signing in with the app specific password.

Same issue here

Mine has quit working also. With the 2024.12 release. Are they working on a 2025 fix for this? I have automations that look for me being home or not home to control locks and lights. And my locks and lights keep going on and off all the time had to disable the automations.

any updates?

Will there come a future update that provides app specific password again? It worked before but stopped working againb after last update to 2024.12.

I thought the whole point was once you had an application password that bypasses 2fa so you don’t need the verification code.

Tried once more. I had used Studio code server but my mistake was to right click custom components and create a folder called icloud and then upload the contents from my pc. Instead i clicked and dragged the icloud folder from my windows explorer window to Home Assistant and uploaded it that way. I also had created an app specific password in icloud that did not work. I had to use my icloud password and even though I have icloud family, I had to untick the family box. Once I did this, I had the list of devices attached to my account including kids phones etc.

You can add the folder / files to the custom_components folder in your config directory.

Works. Add folder as described (delete old one if already there) and just to be sure also delete the icloud folder in .storage Now restart HA then Add Integration. Search icloud and you’ll see the new Apple iCloud with a box icon (custom component) Install, add credentials, away you go. Thanks @PaulCavill.

@PaulCavill Thank you!!! It works perfectly. Deleted the old icloud folder – restart. Copyied your folder in the same directory like the old one. I used Studio Code Server. File Editor will not work. --restart. Installed icloud.

Same issue here -😭

Same. Core version 2024.10.2

Same issue

Same issue here.

Just started getting this…

Logs show…

Logger: pyicloud.base Source: components/icloud/account.py:138 First occurred: 10:20:35 PM (2 occurrences) Last logged: 10:20:35 PM

Service Temporarily Unavailable (503) Authentication required for Account. (450)