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
70.58k stars 29.5k forks source link

iCloud requires verification code even when using app password #121736

Open gtbdf1 opened 1 month ago

gtbdf1 commented 1 month ago

The problem

When using application passwords in iCloud, a verification code is not generated. However, the integration still requires a verification code during set up when using an app specific password.

What version of Home Assistant Core has the issue?

Core-2024.7.2

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

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)

HerveG45 commented 1 month ago

Hello, since creating a specific password for an application, I have been receiving regular error messages in the Home Assistant log. A copy of the message is attached.

Enregistreur: homeassistant.components.icloud.account Source: components/icloud/account.py:173 intégration: Apple iCloud (documentation, problèmes) S'est produit pour la première fois: 10:12:17 (6 occurrences) Dernier enregistrement: 10:22:27

Unknown iCloud error: Authentication required for Account. (450)

Enregistreur: pyicloud.base Source: components/icloud/account.py:171 S'est produit pour la première fois: 10:12:17 (12 occurrences) Dernier enregistrement: 10:22:27

Authentication required for Account. (421) Authentication required for Account. (450)

Pipo31416 commented 1 month ago

Same here since 2024.7.2 Need to refresh manually the states of Apple devices with the service ICLOUD.UPDATE

razvan1despa commented 1 month ago

Hi,

I have the same issue ... using 2024.7.2, Supervisor 2024.06.2, OS 12.4, Frontend 20240710.0. When reconfiguring icloud integration and using in-app password, the verification code is being requested, but apple doesn't generate a code. This leave me without the posibility to use the integration.

If you guys need further logs please let me know and i can provide if needed.

Thanks, Razvan

rake8288 commented 1 month ago

I was also experiencing the same issue. When entering an app-specific password it would prompt for a 2fa code but no request was either sent to Apple or at least none was presented on my devices as one would normally expect.

Troubleshooting Done:

  1. I went in and deleted both the integration and icloud folder in .storage, per docs troubleshooting section and previous experience with this integration.
  2. After complecting the above steps, I went to re-add the integration.

Error occurred during auth flow:

Ex:

image

Error from logs:

2024-07-16 23:35:07.534 ERROR (SyncWorker_59) [pyicloud.base] Missing apple_id field
2024-07-16 23:35:07.534 ERROR (MainThread) [homeassistant.components.icloud.config_flow] Error logging into iCloud service: ('Invalid authentication token.', PyiCloudAPIResponseException('Missing apple_id field'))

At this time the integration is completely unusable as I cannot set it back up.

wneessen commented 1 month ago

Same issue here.

rightsaidfred99 commented 1 month ago

never worked for me

ciddi89 commented 1 month ago

Same problem for me and some other users as reported by @rake8288

bukurat commented 4 weeks ago

I get the same with an app specific password. Makes the integration useless.

cjsmns commented 3 weeks ago

Also have this issue. Using app specific password and it worked for a day or so, and now it's asking for the 2fa code.

I even went into Settings App > (my name) > Sign-in & Security > Two-Factor Authentication > Get Verification Code on my iPhone and tried that code which didn't work.

At the moment the integration is useless.

dyoung522 commented 3 weeks ago

same, same... simply will not authenticate any longer

MrSkutt commented 2 weeks ago

Same problem here.

drudge commented 1 week ago

Same issue here, still prompted for iCloud verification code when using App-specific password, which Apple doesn't send.