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.13k stars 29.81k forks source link

iCloud integeration no longer works #122819

Open aram535 opened 1 month ago

aram535 commented 1 month ago

The problem

Authentication using a app-specific password is giving an authentication error on the screen. The logs point to:

2024-07-29 19:29:32.839 ERROR (SyncWorker_1) [pyicloud.base] Missing apple_id field
2024-07-29 19:29:32.840 ERROR (MainThread) [homeassistant.components.icloud.config_flow] Error logging into iCloud service: ('Invalid authentication token.', PyiCloudAPIResponseException('Missing apple_id field'))

What version of Home Assistant Core has the issue?

2024.7.3

What was the last working version of Home Assistant Core?

2024.7.1

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

Does not get added in as an integration after the authentication failure

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-07-29 19:29:32.839 ERROR (SyncWorker_1) [pyicloud.base] Missing apple_id field
2024-07-29 19:29:32.840 ERROR (MainThread) [homeassistant.components.icloud.config_flow] Error logging into iCloud service: ('Invalid authentication token.', PyiCloudAPIResponseException('Missing apple_id field'))

Additional information

Generated two new app-specific passwords. Removed config/.storage/icloud directory and restarted home assistant before each attempt. Also tried with my normal apple account password, all failed.

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)

HAjerry commented 1 month ago

Same problem and same log messages, but with Home Assistant Core 2024.7.4.

Edit. Now works with the apple id password, not app-specific password.

dyoung522 commented 1 month ago

Same here.

bedeberger commented 1 month ago

same here

nmcc1212 commented 1 month ago

for me, works with apple id password, not with app-specifc password

Telmo commented 1 month ago

same issue app-specific password throws an authentication error

HAjerry commented 1 month ago

same issue app-specific password throws an authentication error

Have you tried to use your regular Apple ID password? That works for me. I guess the documentation should be updated.

nmcc1212 commented 1 month ago

same issue app-specific password throws an authentication error

Have you tried to use your regular Apple ID password? That works for me. I guess the documentation should be updated.

this is a workaround, not a long-term solution, app-specific passwords are used for a reason. Security

HAjerry commented 1 month ago

Guess it depends how the code is written. If the password is kept secret (also for code owner), then there is no harm with using the actual Apple ID password?

rlust commented 1 month ago

What is the answer here, password is working, App and ID password?

nmcc1212 commented 1 month ago

What is the answer here, password is working, App and ID password?

afaik, apple id password works, app-specific passwords (recommended as more secure) don't work

michaeldwilliams commented 1 month ago

Same issue here. Being prompted for a 2FA code when using an app specific password but not automatically receiving a notification for one. And when I generate one manually (via iCloud settings), I get Unknown error occurred in HA. I have done the troubleshooting suggestion of deleting the icloud directory from the .storage directory and restarting HA.

jscherry commented 1 month ago

Got it working with regular (not app specific) password, but device trackers don't show up. It only shows the battery percentages for each device? I even tried deleting the old app specific password and created a new one to no avail?

A-vesalius commented 3 weeks ago

Same issue here. Being prompted for a 2FA code when using an app specific password but not automatically receiving a notification for one. And when I generate one manually (via iCloud settings), I get Unknown error occurred in HA. I have done the troubleshooting suggestion of deleting the icloud directory from the .storage directory and restarting HA.

Same issue

b52src commented 3 weeks ago

Same issue here. Being prompted for a 2FA code when using an app specific password but not automatically receiving a notification for one. And when I generate one manually (via iCloud settings), I get Unknown error occurred in HA. I have done the troubleshooting suggestion of deleting the icloud directory from the .storage directory and restarting HA.

same

aeble commented 2 weeks ago

Looks like the integration is dead as the code owners haven't really responded at all, have they?

Cr4zzyC4t commented 2 weeks ago

Same issue here. Being prompted for a 2FA code when using an app specific password but not automatically receiving a notification for one. And when I generate one manually (via iCloud settings), I get Unknown error occurred in HA. I have done the troubleshooting suggestion of deleting the icloud directory from the .storage directory and restarting HA.

Same

sphen13 commented 2 weeks ago

someone should just request this get deleted. the HACS integration seems to work.

nmcc1212 commented 2 weeks ago

someone should just request this get deleted. the HACS integration seems to work.

is that this one? https://github.com/gcobb321/icloud3

sphen13 commented 2 weeks ago

yessir - icloud3 working well.

aeble commented 2 weeks ago

unfortunately it works with User/Password and not the application specific password.

On Thu, Aug 29, 2024 at 3:32 PM Stephen Boyle @.***> wrote:

yessir - icloud3 working well.

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/122819#issuecomment-2317671427, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5HJJP7GDSGVUIDUOX37V3ZT4PHTAVCNFSM6AAAAABLVHPRG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJXGY3TCNBSG4 . You are receiving this because you commented.Message ID: @.***>

-- Axel Eble Schützenallee 70 79102 Freiburg Germany cell: +49.160.666-5028

piotrantosik commented 1 week ago

Same issue here. Being prompted for a 2FA code when using an app specific password but not automatically receiving a notification for one. And when I generate one manually (via iCloud settings), I get Unknown error occurred in HA. I have done the troubleshooting suggestion of deleting the icloud directory from the .storage directory and restarting HA.

same issue, user/password don't work with 2fa