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
71.62k stars 29.93k forks source link

Apple iCloud authentication does not work as before in v7.x #76280

Closed thprim closed 1 year ago

thprim commented 2 years ago

The problem

When the Apple iCloud integration requests an security code I'll get the request and code on one of my devices, it's not accepted when I enter this digit code in the HASS integration field. It's still not accepted. I detect this issue since I migrated to v.8. several times. The workaround for the time being is currently to add the integration again (the old one can't be deleted), I have to add my account and password. After this, it reports that the integration is still existing and the error is gone. Not sure what the issue is and how it can be fixed the the integration accepts the code when it will be requested from time to time. As the log is showing, it seems the password is not accepting, but, it only requests the digit code, not the password. It's now a bit tricky to get the integration running again. Update: The issue is still existing after the migration vom v.8.x to v.9.x

What version of Home Assistant Core has the issue?

2022.8.x / 2022.9.x

What was the last working version of Home Assistant Core?

2022.7.x

What type of installation are you running?

Home Assistant Container

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?

Authentication required for Account. (421)
08:22:32 – (FEHLER) /usr/local/lib/python3.10/site-packages/pyicloud/base.py - Die Nachricht ist zum ersten Mal um 08:22:19 aufgetreten und erscheint 3 mal
Failed to verify verification code: (401)
08:22:31 – (FEHLER) Apple iCloud
Your password for 'xxx@xxx.de' is no longer working; Go to the Integrations menu and click on Configure on the discovered Apple iCloud card to login again
08:21:35 – (FEHLER) Apple iCloud
Authentication required for Account. (421)
08:21:33 – (FEHLER) components/icloud/account.py

Additional information

The workaround by adding the integration again with an additional instance is working, but it's not really useful, because it says the the integration is still running. Nevertheless, I can add my account and password and then it run's. As described above, the issue is detected since the version 8.0, before it runs well and when the digit code is requested, it was accepted by entering it. It will be helpful, if in the integration which shows the error, a request by entering the complete accounting information can be completed, not only the digit code which is not accepted.

probot-home-assistant[bot] commented 2 years ago

icloud documentation icloud source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years 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! (message by CodeOwnersMention)

eddysteurs commented 2 years ago

I have the same problem at least since uptdate 2022.8.1 (not sure about 2022.8.0)

Mithrox commented 2 years ago

Hi. I just upgraded to 2022.8.1 from 2022.7.x and Apple integration stopped working here as well. Logs show:

Error while setting up icloud platform for device_tracker Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform await asyncio.shield(task) File "/usr/src/homeassistant/homeassistant/components/icloud/device_tracker.py", line 46, in async_setup_entry account.listeners.append( AttributeError: 'IcloudAccount' object has no attribute 'listeners'

When I reload, I get the message saying that the integration need to be Reconfigured. When I do, I get asked username and password, but after 10+ seconds it times out with "Invalid". It may not be the exact same issue, but it appeared after upgrading to 2022.8.1.

sam-ward commented 2 years ago

Seems to be a known issue from the 2022.8 beta #75940

kkangg1 commented 1 year ago

I cannot log in or set up iCloud due to the similar error. OS 2022.10.5 Logger: pyicloud. base Source: /usr/local/lib/python3.10/site-packages/pyicloud/base.py:188 First occurred: 21:36:41 (3 occurrences) Last logged: 21:42:35 Authentication required for Account. (421)

Logger: aiohttp.server Source: components/icloud/config_flow.py:118 First occurred: 21:36:44 (4 occurrences) Last logged: 21:42:38

sam-ward commented 1 year ago

I cannot log in or set up iCloud due to the similar error. OS 2022.10.5

The specific issue in this thread was resolved in 2022.8.3. I would suggest opening a new issue.

issue-triage-workflows[bot] commented 1 year 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.