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.3k stars 30.62k forks source link

iCloud Integration Setup Does Not Generate PIN Code When Physical Security Keys Are Enabled #86499

Open christophermichaelshaw opened 1 year ago

christophermichaelshaw commented 1 year ago

The problem

I am attempting to setup/configure the iCloud Integration, which I have used successfully in the past. After a recent update, it began prompting for re-login/verification code.

I recently set up my AppleID to use my primary and backup Yubikeys. When I enter my credentials, I am prompted for a verification code, which does not appear -- instead, a prompt to verify whether the sign in appears, but does not generate a verification code.

Screenshot 2023-01-23 at 7 26 36 PM

I have searched MacOS and iOS settings high and low to see if the generate verification code option still exists, and it does not.

IMG_F0F652943122-1

Issue occurs on: MacOS Ventura 13.2 iOS 16.3

Home Assistant 2023.1.7 Supervisor 2023.01.0 Operating System 9.4 Frontend 20230110.0 - latest

What version of Home Assistant Core has the issue?

2023.1.7

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 1 year 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` Change the title of 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)

christophermichaelshaw commented 1 year ago

This is what I see when I authenticate with my AppleID credentials (also tried an app password). No verification code is generated/appears.

Screenshot 2023-01-23 at 7 26 19 PM
phrozen77 commented 1 year ago

Just leaving a +1 here, i've also added Yubikeys to my iCloud account and now don't get the verification code sent to me...

I do have generated a new app password, however i cannot seem to set it without getting the verification code beforehand - which just doesn't seem to happen now.

nathang21 commented 1 year ago

Bummer, so effectively it looks like once the auth expires (which happens about every month - separate issue #67510) this means that there is no way to use the iCloud integration with security keys on your apple account.

RPiNut commented 1 year ago

Maybe it's possible to create an App-Specific Password on appleid.apple.com if you have the security key enabled? I don't have added the security keys at the moment, but if I create a App-Specific Password, I didn't prompted to enter a one-time code. I'll test this this evening.

Edit: After resetting de icloud integration, a one-time password isn't allowed to login. This could be the problem for my battery drain problem with icloud turned on on homeassistant.

DIYgod commented 1 year ago

I found a solution, which is to create a family with another account, then connect that account and enable 'with family'.

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.

christophermichaelshaw commented 1 year ago

Issue should remain open pending further investigation/development.

phrozen77 commented 1 year ago

yup, definitely should stay open until someone looks into it...

@Quentame @nzapponi

cknieriem commented 1 year ago

I am having the same issue.

LagaV commented 1 year ago

+1

MrTomek commented 1 year ago

+1

CathaoirMorgan commented 1 year ago

+1

jaxzin commented 1 year ago

Maybe it's possible to create an App-Specific Password on appleid.apple.com if you have the security key enabled?

I wanted to confirm I tried this and it did not work. I get an "Invalid authentication" error when trying to setup iCloud integration in Home Assistant.

s256 commented 1 year ago

From my understanding the App-Specific Password should be the way to go. And should work for everyone, independent of the MFA Setup. But the topic regarding app-specific passwords was flagged here already: https://github.com/home-assistant/core/issues/53926

LagaV commented 1 year ago

App specific password is operational for me. Had to learn, that generating the app specific password only worked via a Chrome based browser, not with Safari. Additionally for me it happened once, that I had to re-setup the integration as it requested some pw authentication. Plus multiple times a day I receive emails informing me about the (integration) login.

pax0707 commented 9 months ago

App-specific password is not working for me.

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

jaxzin commented 6 months ago

This is not solved and I'm still unable to use the iCloud integration on the latest version of HA.

phrozen77 commented 6 months ago

Indeed it is not :(

ianground commented 6 months ago

Still not working for me. Using app specific password and I never get the verification code. Is this issue ever get some attention or are we being asked to abandon this integration? It is very frustrating.

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

cknieriem commented 3 months ago

I have not been able to get this integration to work using solutions mentioned above.

adhithyan15 commented 3 months ago

I just ran into this exact issue as well

andrewgl504 commented 3 months ago

Logging in with the app specific password doesn't prompt the verification code workflow; however, entering my icloud password does. After entering both codes, devices load as expected.

I believe I've run into this before, where it will initialize, but will eventually start asking for a verification code again.

phrozen77 commented 3 months ago

Logging in with the app specific password doesn't prompt the verification code workflow; however, entering my icloud password does. After entering both codes, devices load as expected.

I believe I've run into this before, where it will initialize, but will eventually start asking for a verification code again.

I just tried it again, in the hopes something has changed in the background - nope, still does not work for me.

Just to be real clear: the issue we're talking about here only seems to occur if your account is secured with Yubikey as 2FA (not sure if you got those as well).

Anyways, adding the integration, entering credentials - a popup comes up on my iPhone and Mac - "Someone tried to sign in to iCloud" - now you got the option to say "Nope, wasn't me" - or to "OK" it.

HomeAssistant, in the meanwhile, expects you to enter a code as next step (which does not come - not on screen on any device, nor via eMail).

And this is the problem we're describing here - this pincode usually comes up (along with a map, iirc) if you don't have physical security keys enabled for your specific iCloud account.

Thecodeman35 commented 2 months ago

I don't believe this issue is specific to Yubikey. I'm not using it and I'm still seeing the same issue. I've tried my password as well as an app specific password and while both are accepted, I never receive the confirmation number which Home Assistant requires to continue setting it up. Occassionally through out the day I will receive the login prompt on my phone. I approve it and try and enter the code in HA and it doesn't take it. I just did a reboot of HA and now the addon is working correctly. I still think it's an issue, however.

yecine06 commented 1 month ago

I have the same issue with a yibikey setup on my icloud account.

Even if i enter an app specific password the 2FA popup comesup