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
69.94k stars 29.03k forks source link

ICloud integration has bugs #98083

Open rjnca opened 11 months ago

rjnca commented 11 months ago

The problem

1 - Must use main account password, not an app specific password created from ICloud. Using app specific passwords does not generate a 2FA code, but the integration still asks for one and won't complete without it

2 - After 2FA code is entered, "Invalid Flow Specified" error is received, but this appears to be able to be cancelled without affecting the integration

3 - After a period of time (a month?) integration will stop working and require re-authorization, which means opening Terminal, removing the icloud folder from .storage, and restarting to re-authenticate.

What version of Home Assistant Core has the issue?

2023.8.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Apple 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 11 months 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.

(message by CodeOwnersMention)


icloud documentation icloud source (message by IssueLinks)

DoDoENT commented 11 months ago

The same happens to me. I'm using my iPhone location tracker for presence detection and this stops working after a month or so and requires re-authentication, just the OP described.

byrnecore commented 10 months ago

Has been like this for me for a while too. I have fallen back to google location sharing method which is also patchy. Current fallback is simple device on the network detection.

rhoskins61 commented 10 months ago

Same for me, just not reliable anymore. Probably on Apple IOS side. Used to work beautifully just a few months ago.

Koky05 commented 10 months ago

Same for me, but after shown message "Invalid Flow Specified" I just close window and integration works well again for one month.

hardrockhodl commented 10 months ago

2023-09-17 21:16:23.152 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from xxx.lan 192.x.x.x . Requested URL: '/api/services/device_tracker/see'. (FindMySync/1 CFNetwork/1335.0.3.2 Darwin/21.6.0)

platini76 commented 8 months ago

same problem here

simonwj commented 8 months ago

Same happens for me. Again like roshkins61 it works for about month until I have to re-authenticate.

adwoodworth commented 8 months ago

The problem

1 - Must use main account password, not an app specific password created from ICloud. Using app specific passwords does not generate a 2FA code, but the integration still asks for one and won't complete without it

2 - After 2FA code is entered, "Invalid Flow Specified" error is received, but this appears to be able to be cancelled without affecting the integration

3 - After a period of time (a month?) integration will stop working and require re-authorization, which means opening Terminal, removing the icloud folder from .storage, and restarting to re-authenticate.

What version of Home Assistant Core has the issue?

2023.8.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Apple 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

For what it is worth, I am having the exact same issue, version is 2023.10.5. Periodically, perhaps monthly, maybe bi-monthly, the integration starts causing my iphone to pop up with authentication messages that give an MFA code. Thereafter, the integration will need to be reconfigured, and reconfiguring asks for only password and seems to authenticate successfully. It will do this repeatedly for a couple days and then, seemingly at random, the integration, when reconfigured will also ask for an authentication code. I enter the code, and all is well for a month or two and then I repeat the process all over again. It has been like that for well over a year, maybe two.

Koky05 commented 8 months ago

I never did this: "which means opening Terminal, removing the icloud folder from .storage, and restarting to re-authenticate.". Just add again main password confirm request on iOS device and continue in using Integrations.

issue-triage-workflows[bot] commented 5 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

DoDoENT commented 5 months ago

I still have the same issue, using the latest version of Home Assistant and iCloud integration.

wibbly commented 4 months ago

Not stale. Still an ongoing issue with all the latest versions.

razvan1despa commented 3 months ago

Hi,

I am facing the issue 1 also while using HA Core 2024.4.1, Supervisor 2024.04.0, Operating system 12.0 and frontend 20240404.1 Any feedback from HA team on this as it is now integrated into HA Core integrations?

I am using it to track Apple Watch. I need to run periodically the service "icloud.update" to get the locations. Can someone explain if there is any rule based on which this integration interacts with iCloud to get location?

Thanks, Razvan

tekHudson commented 2 months ago

+1 here for issue. @Quentame, @nzapponi Are either of you actively developing/supporting this extension?

woody166 commented 1 month ago

I have also been receiving this issue for several months now, having to go through re-authentication at least once a month.

DTTerastar commented 2 weeks ago

I think using uppercase in the email might be a root cause. It makes files in .storage/icloud with the upper case in some of the code paths.

tekHudson commented 1 week ago

@DTTerastar No uppercase in emails here