home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.98k stars 31.02k forks source link

iCloud integration stopped working (due to Apple SRP-6a implementation) #128830

Open crazyelectron-io opened 1 month ago

crazyelectron-io commented 1 month ago

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

home-assistant[bot] commented 1 month ago

Hey there @quentame, @nzapponi, mind taking a look at this issue as it has been labeled with an integration (icloud) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `icloud` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign icloud` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


icloud documentation icloud source (message by IssueLinks)

eddysteurs commented 1 month ago

follow

nstefanelli commented 1 month ago

having this issue as well - following

platterscratch commented 1 month ago

Same. Following.

mdeuerlein commented 1 month ago

same here

RadDip commented 1 month ago

same

GRClark commented 1 month ago

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)

RosemaryOrchard commented 1 month ago

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 😄

dbruynb commented 1 month ago

👍 Same issue

voyagerft commented 1 month ago

stesso identico problema

HanyDaim commented 1 month ago

Same error! IMG_4239

FarleighRed commented 1 month ago

👍

slaygirlz commented 1 month ago

welp

ProtossBlaster commented 1 month ago

Same Problem

mzspicoli commented 1 month ago

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.

noahlishere commented 1 month ago

Same issue here.

online-geek commented 1 month ago

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.

wwpjm06 commented 1 month ago

👍

AJAX-domo commented 1 month ago

The problem is still present.

ArnoldGoat commented 1 month ago

Same problem. Reverting to 2024.10.1 did not fix it.

barbadaniele commented 1 month ago

Same issue

mhjansen79 commented 1 month ago

Same problem. Reverting to 2024.10.1 did not fix it.

This is a change in iCloud’s authentication method, so reverting wouldn’t fix this.

The integration needs to be adjusted to be able to use apples new authentication mechanism.

Genieplumb commented 1 month ago

same here

jaimiejoey commented 1 month ago

Same. Core version 2024.10.2

maxkot75 commented 1 month ago

Same issue here -;(

lizardclaw8 commented 1 month ago

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

for base.py

DoWenzl94 commented 1 month ago

Same issue here -;(

nicokars commented 1 month ago

same problem .. delete de app icloud reboot install the app works... but after restart... it gives the same error

PaulCavill commented 1 month ago

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

icloud.zip

platterscratch commented 1 month ago

Since I'm a toddler in this world, would you mind telling me how I can install this please?

Thanks a ton!

PaulCavill commented 1 month ago

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

image

theunknownstarman commented 1 month ago

works 👌🏻

eddysteurs commented 1 month ago

where should it appear after you put it in the custom_components folder? Or is there something else you need to do? found it, added an integration, but it did not accept my apple application password but needed my normal user password Solved:-)

HanyDaim commented 1 month ago

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

image

Works, thank you!

HanyDaim commented 1 month ago

Unfortunately, the problem happened again after restarting!!

mhjansen79 commented 1 month ago

can we merge this with #128811 ?

Wibbie commented 1 month ago

@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.

online-geek commented 1 month ago

I've tried the same process at Wibbie and it errors :

Error Config flow could not be loaded: {"message":"Invalid handler specified"}

buds commented 1 month ago

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.

buds commented 1 month ago

I've tried the same process at Wibbie and it errors :

Error Config flow could not be loaded: {"message":"Invalid handler specified"}

Same here. Delete it and put back the old one. Now do @PaulCavill folder as described above.

online-geek commented 1 month ago

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.

quim-net commented 1 month ago

Hi, I have followed these steps from Wibbie, and it works fine, thank you very much

image

swampylee commented 1 month ago

I tried this but all I get is **"[custom_components.icloud.config_flow] Error logging into iCloud service: ('Invalid authentication token.', PyiCloudAPIResponseException('Missing apple_id field (Missing apple_id field)'))"** in the logs.

appleimperio commented 1 month ago

@swampylee did you try your apple id password instead of the one you create specific to this service? In my case I have to use my apple id password

stowers95120 commented 1 month ago

This is also not working for me. I've have copied the custom component (following instructions above). But when I try to add the integration I get an invalid_auth response. This is what is in the logs: This error originated from a custom integration.

Logger: custom_components.icloud.config_flow Source: custom_components/icloud/config_flow.py:128 integration: Apple iCloud First occurred: October 24, 2024 at 7:00:14 PM (9 occurrences) Last logged: 10:17:08 AM

Error logging into iCloud service: ('Invalid authentication token.', PyiCloudAPIResponseException('Missing apple_id field (Missing apple_id field)'))

swampylee commented 1 month ago

@swampylee did you try your apple id password instead of the one you create specific to this service? In my case I have to use my apple id password

Yep I did.

swampylee commented 1 month ago

This is also not working for me. I've have copied the custom component (following instructions above). But when I try to add the integration I get an invalid_auth response. This is what is in the logs: This error originated from a custom integration.

Logger: custom_components.icloud.config_flow Source: custom_components/icloud/config_flow.py:128 integration: Apple iCloud First occurred: October 24, 2024 at 7:00:14 PM (9 occurrences) Last logged: 10:17:08 AM

Error logging into iCloud service: ('Invalid authentication token.', PyiCloudAPIResponseException('Missing apple_id field (Missing apple_id field)'))

Same errors as I’m seeing.

rgabrielson11 commented 1 month ago

Tried both app-specific and my main apple ID. broken here too.

wwpjm06 commented 1 month ago

Works for me. I expanded the zip file on my MacBook. Deleted the iCloud folder in .storage Rebooted HA FTP’d the expanded folder into custom_components folder Rebooted HA again Added Apple iCloud integration Typed in appleid and main appleid pwd All worked👍

kai-seipp commented 1 month ago

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.