# iCloud binding, authentication problem

**URL:** <https://community.openhab.org/t/icloud-binding-authentication-problem/159739>\
**Category:** Bindings\
**Created:** [October 19, 2024, 4:39am UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739 "2024-10-19T04:39:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![scuba](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/a88e57/32.png) [@scuba](https://community.openhab.org/u/scuba)\
**Post date:** [October 19, 2024, 4:39am UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/1 "2024-10-19T04:39:57Z")

</div>

Hello,

I have an authentication problem with an iCloud account.

After installing the binding everything worked perfectly. Then after restarting OH 4.2.2 there was a warning:  
[WARN] [l.handler.ICloudAccountBridgeHandler] - iCloud authentication failed. Invalid credentials.

Unfortunately, re-entering the user ID and password did not improve the situation. If I log in directly via the browser at [https://www.icloud.com/](https://www.icloud.com/), the login details work perfectly, so they are definitely correct.

Reinstalling the binding did not improve the situation, what else can I do?

Regards  
Hans-Jürgen

---

<div class="post-metadata">

**Author:** ![Flip](https://community.openhab.org/letter_avatar_proxy/v4/letter/f/53a042/32.png) [@Flip](https://community.openhab.org/u/Flip)\
**Post date:** [October 19, 2024, 4:58am UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/2 "2024-10-19T04:58:21Z")

</div>

Same here

---

<div class="post-metadata">

**Author:** ![emiel](https://community.openhab.org/letter_avatar_proxy/v4/letter/e/57b2e6/32.png) [@emiel](https://community.openhab.org/u/emiel)\
**Post date:** [October 19, 2024, 6:28am UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/3 "2024-10-19T06:28:06Z")

</div>

perhaps the 2fa code? could be that it needs to be re-entered after a reboot.

---

<div class="post-metadata">

**Author:** ![scuba](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/a88e57/32.png) [@scuba](https://community.openhab.org/u/scuba)\
**Post date:** [October 19, 2024, 6:46am UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/4 "2024-10-19T06:46:11Z")

</div>

The problem is that the iPhone doesn’t even display a 2FA code that you could enter.

---

<div class="post-metadata">

**Author:** ![tally](https://community.openhab.org/user_avatar/community.openhab.org/tally/32/71903_2.png) [@tally](https://community.openhab.org/u/tally)\
**Post date:** [October 19, 2024, 10:29am UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/5 "2024-10-19T10:29:06Z")

</div>

I have this exact problem after reboot. Created [an issue](https://github.com/openhab/openhab-addons/issues/17590) on GitHub.

---

<div class="post-metadata">

**Author:** ![pleedell](https://community.openhab.org/letter_avatar_proxy/v4/letter/p/d78d45/32.png) [@pleedell](https://community.openhab.org/u/pleedell)\
**Post date:** [October 19, 2024, 10:55am UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/6 "2024-10-19T10:55:13Z")

</div>

Same problem here (originally posted on the 4.3.0M2 thread). This is on openhabian/pi4. I updated to the new milestone and immediately found icloud no longer connects. It will trigger a 2fa prompt that I’ll see on my apple devices and I do get the automated ‘we’ve received a password login from this address, if this was you do nothing’ email note from apple. ie. Apple seems to think there was a valid login. But the icloud account thing never gets updated to ‘Online’ and will end up in status ‘ERROR: CONFIG.’ Log shows invalid 2fa token.

Not sure how to fix, but I’m happy to help test a solution.  
Cheers

2024-10-15 06:09:42.255 [WARN] [l.handler.ICloudAccountBridgeHandler] - iCloud authentication requires 2-FA code. Please provide code configuration for thing ‘icloud:account:872293b897’.

2024-10-15 06:09:42.256 [INFO] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘icloud:account:872293b897’ changed from UNKNOWN to OFFLINE (CONFIGURATION\_ERROR): Please provide 2-FA code in thing configuration.

2024-10-15 06:10:26.757 [INFO] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘icloud:account:872293b897’ changed from OFFLINE (CONFIGURATION\_ERROR): Please provide 2-FA code in thing configuration. to UNKNOWN

2024-10-15 06:14:40.235 [WARN] [l.handler.ICloudAccountBridgeHandler] - ICloud token invalid.

2024-10-15 06:14:40.238 [INFO] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘icloud:account:872293b897’ changed from UNKNOWN to OFFLINE (CONFIGURATION\_ERROR): Invalid 2-FA-code.

---

<div class="post-metadata">

**Author:** ![tally](https://community.openhab.org/user_avatar/community.openhab.org/tally/32/71903_2.png) [@tally](https://community.openhab.org/u/tally)\
**Post date:** [October 19, 2024, 10:58am UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/7 "2024-10-19T10:58:23Z")

</div>

Also my trace logs if that’s of any help:

```auto
2024-10-19 13:51:23.766 [DEBUG] [l.handler.ICloudAccountBridgeHandler] - iCloud bridge handler initializing ...
2024-10-19 13:51:23.775 [DEBUG] [l.handler.ICloudAccountBridgeHandler] - iCloud bridge handler initialized.
2024-10-19 13:51:23.793 [DEBUG] [l.handler.ICloudAccountBridgeHandler] - Starting iCloud authentication (AuthState=INITIAL, Thing=icloud:account:63f7cfe3c6)...
2024-10-19 13:51:23.797 [DEBUG] [inding.icloud.internal.ICloudService] - Checking session token validity
2024-10-19 13:51:23.802 [DEBUG] [inding.icloud.internal.ICloudSession] - iCloud request POST https://setup.icloud.com/setup/ws/1/validate.
2024-10-19 13:51:23.810 [TRACE] [inding.icloud.internal.ICloudSession] - Calling https://setup.icloud.com/setup/ws/1/validate
Headers -----
java.net.http.HttpHeaders@db4184c6 { {Origin=[https://www.icloud.com], Referer=[https://www.icloud.com/]} }
Body -----
null
------
2024-10-19 13:51:24.551 [TRACE] [inding.icloud.internal.ICloudSession] - Result https://setup.icloud.com/setup/ws/1/validate 421
Headers -----
java.net.http.HttpHeaders@f86910c7 { {access-control-allow-credentials=[true], access-control-allow-origin=[https://www.icloud.com], access-control-expose-headers=[X-Apple-Request-UUID,Via], cache-control=[no-cache, no-store, private], connection=[keep-alive], content-length=[1403], content-type=[application/json; charset=UTF-8], date=[Sat, 19 Oct 2024 10:51:24 GMT], server=[AppleHttpServer/b866cf47a603], strict-transport-security=[max-age=31536000; includeSubDomains;], via=[xrail:mr42p00ic-qujn09141701.me.com:8301:24R504:grp20,631194250daa17e24277dea86cf30319:8f0ada2b7d17e60a1728f24fa3127b29:deber3], x-apple-edge-response-time=[147], x-apple-request-uuid=[b9781658-24b1-4161-9e9d-f7cb9df5f690], x-apple-user-partition=[60], x-responding-instance=[setupservice:36001001:mr51p60ic-qukt04081502:8001:2426B654:a2ab3064ebcf]} }
Body -----
{"success":false,"requestInfo":[{"country":"NL","timeZone":"GMT+1"}],"configBag":{"urls":{"accountCreateUI":"https://appleid.apple.com/widget/account/?widgetKey=d39ba9916b7251055b22c7f910e2ea796ee65e98b2ddecea8f5dde8d9d1a815d#!create","accountVerifyUI":"https://id.apple.com/identity?widgetKey=d39ba9916b7251055b22c7f910e2ea796ee65e98b2ddecea8f5dde8d9d1a815d","accountLoginUI":"https://idmsa.apple.com/appleauth/auth/signin?widgetKey=d39ba9916b7251055b22c7f910e2ea796ee65e98b2ddecea8f5dde8d9d1a815d","accountLogin":"https://setup.icloud.com/setup/ws/1/accountLogin","accountRepairUI":"https://appleid.apple.com/widget/account/?widgetKey=d39ba9916b7251055b22c7f910e2ea796ee65e98b2ddecea8f5dde8d9d1a815d#!repair","downloadICloudTerms":"https://setup.icloud.com/setup/ws/1/downloadLiteTerms","repairDone":"https://setup.icloud.com/setup/ws/1/repairDone","accountAuthorizeUI":"https://idmsa.apple.com/appleauth/auth/authorize/signin?client_id=d39ba9916b7251055b22c7f910e2ea796ee65e98b2ddecea8f5dde8d9d1a815d","vettingUrlForEmail":"https://id.apple.com/IDMSEmailVetting/vetShareEmail","accountCreate":"https://setup.icloud.com/setup/ws/1/createLiteAccount","getICloudTerms":"https://setup.icloud.com/setup/ws/1/getTerms","vettingUrlForPhone":"https://id.apple.com/IDMSEmailVetting/vetSharePhone"},"accountCreateEnabled":true,"isEnhancedProtectionRegion":false},"error":"Missing X-APPLE-WEBAUTH-TOKEN cookie"}
------
2024-10-19 13:51:24.557 [DEBUG] [inding.icloud.internal.ICloudService] - Token is not valid. Attemping new login.
org.openhab.binding.icloud.internal.ICloudApiResponseException: Request https://setup.icloud.com/setup/ws/1/validate failed with 421.
	at org.openhab.binding.icloud.internal.ICloudSession.request(ICloudSession.java:148) ~[?:?]
	at org.openhab.binding.icloud.internal.ICloudSession.post(ICloudSession.java:98) ~[?:?]
	at org.openhab.binding.icloud.internal.ICloudService.validateToken(ICloudService.java:190) ~[?:?]
	at org.openhab.binding.icloud.internal.ICloudService.authenticate(ICloudService.java:94) ~[?:?]
	at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.checkLogin(ICloudAccountBridgeHandler.java:338) ~[?:?]
	at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.callApiWithRetryAndExceptionHandling(ICloudAccountBridgeHandler.java:164) ~[?:?]
	at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.lambda$2(ICloudAccountBridgeHandler.java:127) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
	at java.lang.Thread.run(Thread.java:840) [?:?]
2024-10-19 13:51:24.575 [DEBUG] [inding.icloud.internal.ICloudService] - Authenticating as censored@gmail.com...
2024-10-19 13:51:24.581 [DEBUG] [inding.icloud.internal.ICloudSession] - iCloud request POST https://idmsa.apple.com/appleauth/auth/signin?isRememberMeEnabled=true.
2024-10-19 13:51:24.587 [TRACE] [inding.icloud.internal.ICloudSession] - Calling https://idmsa.apple.com/appleauth/auth/signin?isRememberMeEnabled=true
Headers -----
java.net.http.HttpHeaders@bf3ef8e0 { {Accept=[*/*], Content-Type=[application/json], Origin=[https://www.icloud.com], Referer=[https://www.icloud.com/], X-Apple-OAuth-Client-Id=[d39ba9916b7251055b22c7f910e2ea796ee65e98b2ddecea8f5dde8d9d1a815d], X-Apple-OAuth-Client-Type=[firstPartyAuth], X-Apple-OAuth-Redirect-URI=[https://www.icloud.com], X-Apple-OAuth-Require-Grant-Code=[true], X-Apple-OAuth-Response-Mode=[web_message], X-Apple-OAuth-Response-Type=[code], X-Apple-OAuth-State=[auth-b80ca0e1-6cad-4dcf-9f77-f7e1405b96bf], X-Apple-Widget-Key=[d39ba9916b7251055b22c7f910e2ea796ee65e98b2ddecea8f5dde8d9d1a815d]} }
Body -----
{"password":"censored","accountName":"censored@gmail.com","trustTokens":["HSARMTKNSRVXWFlalyxsgDULFpQsKJ6EMb0EZMimYMVwGthfCbBqFtPVMNSZf1o7loXhq/PobYU1kZ1c11XrjRPeERbJ2zAlsW0MgwmsxpxgaWCQJBZGddsFPKrla/ntlNu+bnw9yRf8Q5ZUzEYtCBaV4GN04+kFJMuM4+zEYMDXwPXvQascqsftN/Tq75BqKU/6twbzWWTo8HF+rdmLEFS21i4xidaHrWujl6OV01X/ARE\u003dSRVT"],"rememberMe":true}
------
2024-10-19 13:51:25.423 [TRACE] [inding.icloud.internal.ICloudSession] - Result https://idmsa.apple.com/appleauth/auth/signin?isRememberMeEnabled=true 503
Headers -----
java.net.http.HttpHeaders@260031ae { {connection=[keep-alive], content-length=[190], content-type=[text/html], date=[Sat, 19 Oct 2024 10:51:25 GMT], server=[Apple]} }
Body -----
<html>
<head><title>503 Service Temporarily Unavailable</title></head>
<body>
<center><h1>503 Service Temporarily Unavailable</h1></center>
<hr><center>Apple</center>
</body>
</html>
------
2024-10-19 13:51:25.429 [WARN] [l.handler.ICloudAccountBridgeHandler] - iCloud authentication failed. Invalid credentials.

```

---

<div class="post-metadata">

**Author:** ![Chri46](https://community.openhab.org/letter_avatar_proxy/v4/letter/c/f08c70/32.png) [@Chri46](https://community.openhab.org/u/Chri46)\
**Post date:** [October 19, 2024, 1:16pm UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/8 "2024-10-19T13:16:44Z")

</div>

same here - today´s restart of OH broke authentication - running on 4.2.2 release build.  
Had a restart of Openhab yesterday around lunch time CET (short power outage) no issue seen.

---

<div class="post-metadata">

**Author:** ![Bucofski](https://community.openhab.org/user_avatar/community.openhab.org/bucofski/32/61553_2.png) [@Bucofski](https://community.openhab.org/u/Bucofski)\
**Post date:** [October 19, 2024, 1:40pm UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/9 "2024-10-19T13:40:24Z")

</div>

Same here after reboot.

---

<div class="post-metadata">

**Author:** ![Phuong](https://community.openhab.org/user_avatar/community.openhab.org/phuong/32/112488_2.png) [@Phuong](https://community.openhab.org/u/Phuong)\
**Post date:** [October 19, 2024, 2:24pm UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/10 "2024-10-19T14:24:48Z")

</div>

same here

---

<div class="post-metadata">

**Author:** ![kkinget](https://community.openhab.org/user_avatar/community.openhab.org/kkinget/32/105717_2.png) [@kkinget](https://community.openhab.org/u/kkinget)\
**Post date:** [October 19, 2024, 3:31pm UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/11 "2024-10-19T15:31:21Z")

</div>

> [@pleedell](#):
>
> ‘icloud:account:872293b897’ changed from OFFLINE (CONFIGURATION\_ERROR): Please

same here

---

<div class="post-metadata">

**Author:** ![oakguy](https://community.openhab.org/user_avatar/community.openhab.org/oakguy/32/41435_2.png) [@oakguy](https://community.openhab.org/u/oakguy)\
**Post date:** [October 19, 2024, 6:05pm UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/12 "2024-10-19T18:05:27Z")

</div>

Same here

---

<div class="post-metadata">

**Author:** ![WeRo](https://community.openhab.org/user_avatar/community.openhab.org/wero/32/106083_2.png) [@WeRo](https://community.openhab.org/u/WeRo)\
**Post date:** [October 20, 2024, 8:31am UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/13 "2024-10-20T08:31:07Z")

</div>

@maihacke  
Could you help at this issue?

---

<div class="post-metadata">

**Author:** ![CrazyElectron](https://community.openhab.org/user_avatar/community.openhab.org/crazyelectron/32/79458_2.png) [@CrazyElectron](https://community.openhab.org/u/CrazyElectron)\
**Post date:** [October 20, 2024, 2:45pm UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/14 "2024-10-20T14:45:15Z")

</div>

This issue is likely due to a change on Apple’s side. Home Assistant and others are having the same issue. It looks like Apple switched to SRP-6a (Secure Remote Password) protocol.

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [October 20, 2024, 8:57pm UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/15 "2024-10-20T20:57:16Z")

</div>

Assuming that’s the cause, presumably something needs to change in the cloud server to work with that protocol, right? If so can someone please file an issue with the cloud server repo with all the details.

---

<div class="post-metadata">

**Author:** ![mvo](https://community.openhab.org/user_avatar/community.openhab.org/mvo/32/36681_2.png) [@mvo](https://community.openhab.org/u/mvo)\
**Post date:** [October 22, 2024, 1:45pm UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/16 "2024-10-22T13:45:39Z")

</div>

Hello Colleagues, did someone have find a workaround about it?

---

<div class="post-metadata">

**Author:** ![Metall4You](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/f1d935/32.png) [@Metall4You](https://community.openhab.org/u/Metall4You)\
**Post date:** [October 23, 2024, 8:15pm UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/17 "2024-10-23T20:15:48Z")

</div>

Hello  
I updated to openhab 4.2.2 and now the 2fa code is no longer displayed on the cell phone. Is there already a solution or should I reinstall the binding?

thanks for your tips

---

<div class="post-metadata">

**Author:** ![JensH](https://community.openhab.org/user_avatar/community.openhab.org/jensh/32/33433_2.png) [@JensH](https://community.openhab.org/u/JensH)\
**Post date:** [October 23, 2024, 8:36pm UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/18 "2024-10-23T20:36:20Z")

</div>

I had same issue on 20th of october, yesterday I was able to disable thing and enabled again: Bridge came directly up online without asking for a new 2FA.. Today I needed to restart openhab, now bridges are again offline with invalid credentials.

Not sure if it just was an old server or it’s a caching issue in the background? Not sure if this information helps anyone.

---

<div class="post-metadata">

**Author:** ![JensH](https://community.openhab.org/user_avatar/community.openhab.org/jensh/32/33433_2.png) [@JensH](https://community.openhab.org/u/JensH)\
**Post date:** [October 24, 2024, 12:25am UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/19 "2024-10-24T00:25:37Z")

</div>

Thanks. In that issue someone posted a link to a solution based on pycloud.

So the fix needs to be done in binding too.

My yesterday disable / enable was only a moment of luck.

---

<div class="post-metadata">

**Author:** ![mvo](https://community.openhab.org/user_avatar/community.openhab.org/mvo/32/36681_2.png) [@mvo](https://community.openhab.org/u/mvo)\
**Post date:** [October 24, 2024, 1:57pm UTC](https://community.openhab.org/t/icloud-binding-authentication-problem/159739/20 "2024-10-24T13:57:32Z")

</div>

> [@JensH](#):
>
> ab, now bridges are again offline with invalid credentials.

Have you ever used pycloud?

[Next page](https://community.openhab.org/t/icloud-binding-authentication-problem/159739.md?page=2)
