Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iCloud integration stopped working (due to Apple SRP-6a implementation) #128830

Open
crazyelectron-io opened this issue Oct 20, 2024 · 71 comments
Open
Assignees

Comments

@crazyelectron-io
Copy link

The problem

The iCloud integration fix recently merged to support App Passwords relies on a one-time login with the 'regular' password and MFA prompt. However, Apple has updated their side and now require Secure Remote Password protocol which is currently not supported by PyiCloud. As a result the iCloud integration no longer works.
BTW, it is already reported in the PyiCloud repo.

I opened this issue because the App Password issue was closed when the mentioned fix was merged.

What version of Home Assistant Core has the issue?

core-2024.10.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

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
Copy link

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)

@eddysteurs
Copy link

follow

@nstefanelli
Copy link

having this issue as well - following

@platterscratch
Copy link

Same. Following.

@mdeuerlein
Copy link

same here

@RadDip
Copy link

RadDip commented Oct 20, 2024

same

@GRClark
Copy link

GRClark commented Oct 21, 2024

Just started getting this...

Logs show....

Logger: pyicloud.base
Source: components/icloud/account.py:138
First occurred: 10:20:35 PM (2 occurrences)
Last logged: 10:20:35 PM

Service Temporarily Unavailable (503)
Authentication required for Account. (450)

@RosemaryOrchard
Copy link

A reminder to everyone that GitHub does have a "subscribe" feature you can use to follow this issue, and if you add a 👍 to the original post there'll be an easy count of people experiencing the same issue 😄

@dbruynb
Copy link

dbruynb commented Oct 21, 2024

👍 Same issue

@voyagerft
Copy link

stesso identico problema

@HanyDaim
Copy link

Same error!
IMG_4239

@FarleighRed
Copy link

👍

@slaygirlz
Copy link

welp

@ProtossBlaster
Copy link

Same Problem

@mzspicoli
Copy link

To avoid excessive notifications for everyone subscribed, please do not comment if you have the same issue. The owner is already informed. Instead, consider liking the original post and subscribing to updates.

@noahlishere
Copy link

Same issue here.

@online-geek
Copy link

I too am having this issue.

Whilst I know it is being worked on, is there a workaround as I have automations that rely on my Iphone and they do not currently work.

@wwpjm06
Copy link

wwpjm06 commented Oct 22, 2024

👍

@AJAX-domo
Copy link

The problem is still present.

@ArnoldGoat
Copy link

Same problem. Reverting to 2024.10.1 did not fix it.

@barbadaniele
Copy link

Same issue

@mhjansen79
Copy link

Same problem. Reverting to 2024.10.1 did not fix it.

This is a change in iCloud’s authentication method, so reverting wouldn’t fix this.

The integration needs to be adjusted to be able to use apples new authentication mechanism.

@Genieplumb
Copy link

same here

@jaimiejoey
Copy link

Same. Core version 2024.10.2

@maxkot75
Copy link

Same issue here -;(

@lizardclaw8
Copy link

Check the fix for pyicloud at picklepete/pyicloud#456

for base.py

@swampylee
Copy link

I tried this but all I get is **"[custom_components.icloud.config_flow] Error logging into iCloud service: ('Invalid authentication token.', PyiCloudAPIResponseException('Missing apple_id field (Missing apple_id field)'))"** in the logs.

@appleimperio
Copy link

@swampylee did you try your apple id password instead of the one you create specific to this service? In my case I have to use my apple id password

@stowers95120
Copy link

This is also not working for me. I've have copied the custom component (following instructions above). But when I try to add the integration I get an invalid_auth response.
This is what is in the logs:
This error originated from a custom integration.

Logger: custom_components.icloud.config_flow
Source: custom_components/icloud/config_flow.py:128
integration: Apple iCloud
First occurred: October 24, 2024 at 7:00:14 PM (9 occurrences)
Last logged: 10:17:08 AM

Error logging into iCloud service: ('Invalid authentication token.', PyiCloudAPIResponseException('Missing apple_id field (Missing apple_id field)'))

@swampylee
Copy link

@swampylee did you try your apple id password instead of the one you create specific to this service? In my case I have to use my apple id password

Yep I did.

@swampylee
Copy link

This is also not working for me. I've have copied the custom component (following instructions above). But when I try to add the integration I get an invalid_auth response. This is what is in the logs: This error originated from a custom integration.

Logger: custom_components.icloud.config_flow Source: custom_components/icloud/config_flow.py:128 integration: Apple iCloud First occurred: October 24, 2024 at 7:00:14 PM (9 occurrences) Last logged: 10:17:08 AM

Error logging into iCloud service: ('Invalid authentication token.', PyiCloudAPIResponseException('Missing apple_id field (Missing apple_id field)'))

Same errors as I’m seeing.

@rgabrielson11
Copy link

Tried both app-specific and my main apple ID. broken here too.

@wwpjm06
Copy link

wwpjm06 commented Oct 26, 2024

Works for me.
I expanded the zip file on my MacBook.
Deleted the iCloud folder in .storage
Rebooted HA
FTP’d the expanded folder into custom_components folder
Rebooted HA again
Added Apple iCloud integration
Typed in appleid and main appleid pwd
All worked👍

@kai-seipp
Copy link

kai-seipp commented Oct 26, 2024

It's good to know that there is a workaround. But is there already something done do work on a fix for this integration? I think for most users it would be the best solution go get this integration back to working with the next HA release.

@PaulCavill
Copy link

We first have to make contact with the maintainers of the pyiCloud project to get this solved.

There has been a PR submitted already that contains a fix, just need the maintainers to approve and deployed.

I have emailed one of the maintainers, Just waiting for a response currently.

@HanyDaim
Copy link

We first have to make contact with the maintainers of the pyiCloud project to get this solved.

There has been a PR submitted already that contains a fix, just need the maintainers to approve and deployed.

I have emailed one of the maintainers, Just waiting for a response currently.

Please be informed that tracking is also unavailable for MacBooks. Additionally, could you advise on how to reduce the battery update interval? It currently takes considerable time to display the accurate percentage, which impacts an automation I’ve set up to remind me to charge my iPhone, iPad, and Apple Watch.

@BlaXun
Copy link

BlaXun commented Oct 27, 2024

You can add the folder / files to the custom_components folder in your config directory.

image

Yeah, that does work.... but using direct credentials instead of app specific PW ...can't be a long-time solution, can it?

@Jobey88
Copy link

Jobey88 commented Oct 27, 2024

You can add the folder / files to the custom_components folder in your config directory.

image

this worked for me. thank you

@fehgab
Copy link

fehgab commented Nov 2, 2024

The attached custom component works, thank you.

@xynxxy
Copy link

xynxxy commented Nov 3, 2024

When I use the customPackage, I regularly receive emails from iCloud authentication. Is there a solution for this?

@egpall
Copy link

egpall commented Nov 3, 2024

How do you know it's this integration that's trying to access it and not someone trying to get into your account? I've always had this happen to me even with the other way, I never trust it's someone and don’t give them permission, it's really annoying

@Mithrox
Copy link

Mithrox commented Nov 3, 2024

When I use the customPackage, I regularly receive emails from iCloud authentication. Is there a solution for this?

Every 30 days I had to remove plugin, delete the icloud folder, restart HA and activate plugin again, at which point auth worked fine and I got 30 more days. Apple require new auth every month, and the plugin did not handle it correct. Takes 2 mins every month once you know about it though.

@jacdyb
Copy link

jacdyb commented Nov 3, 2024

Same here, following ;) thanks for fix, it does not work for me when using app password and I don't want to use my main account password.

@wmsunder
Copy link

wmsunder commented Nov 3, 2024

This is brilliant! Works well. Thank you!

@hjkcai
Copy link

hjkcai commented Nov 5, 2024

This patch does not work for me. I entered my email and app-specific password but it says "Invalid authentication". I did't previously used this integration. It's a new setup. The log says "Missing apple_id field"

2024-11-05 11:37:23.055 ERROR (SyncWorker_42) [custom_components.icloud.pyicloud_ipd.session] Missing apple_id field (Missing apple_id field)
2024-11-05 11:37:23.056 ERROR (MainThread) [custom_components.icloud.config_flow] Error logging into iCloud service: ('Invalid authentication token.', PyiCloudAPIResponseException('Missing apple_id field (Missing apple_id field)'))
image

@rgabrielson11
Copy link

rgabrielson11 commented Nov 5, 2024 via email

@hjkcai
Copy link

hjkcai commented Nov 5, 2024

You have to use your primary password

@rgabrielson11 I have tried my primary password. It's the same result.

@stowers95120
Copy link

stowers95120 commented Nov 5, 2024 via email

@PaulCavill
Copy link

PaulCavill commented Nov 5, 2024

Note: App specific passwords have never worked in this integration.

Also in this temporary manual install the wording was updated.

HA might need a restart to load the files you have copied into your setup.

Screenshot_20241105-182339.png

@aram535
Copy link

aram535 commented Nov 5, 2024

What's the difference in allowing primary pass vs app specific? Is it just a different endpoint? I'm happy to contribute code.

@lcoll154
Copy link

lcoll154 commented Nov 6, 2024

SO I was able to log in using the above instructions to add to custom_components. However iCloud keeps sending me 2FA notifications every 30 minutes to authenticate. When I remove the entities it stops sending the notification. Any idea when this is going to be fixed?

@Phoenix-DH
Copy link

Will that be fixed in 2024.11.0?

@Mithrox
Copy link

Mithrox commented Nov 6, 2024

SO I was able to log in using the above instructions to add to custom_components. However iCloud keeps sending me 2FA notifications every 30 minutes to authenticate. When I remove the entities it stops sending the notification. Any idea when this is going to be fixed?

Read my post further up. Remove the integration, remove the iCloud folder, Add the custom_components folder, restart HA, setup the integration over again and then set up with user/pass/2FA. At that point you get 30 days before next 2FA auth is required. This custom integration works just the same as the native one did before they changed it.

@lcoll154
Copy link

lcoll154 commented Nov 6, 2024

Yes, that is what I followed, I will do it again and see what happens.
I removed the integration, restarted, copied the files to the custom components, restarted and then installed the new integration and entered my credentials and started getting notifications every 30 min for 2fa so I removed everything again

@aram535
Copy link

aram535 commented Nov 6, 2024

Do we know when this will be included in the next home assistant release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests