core: Home Connect Auth Error
The problem
After Update, HA says “Integration requires reconfiguration” Reonfiguration doesn’t work. “No devices or entities Setup error: Authentication error: The provided token is malformed. (invalid_token). Please authenticate your account again.”
What version of Home Assistant Core has the issue?
core-2025.3.0
What was the last working version of Home Assistant Core?
core-2025.2.4
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Home Connect
Link to integration documentation on our website
https://www.home-assistant.io/integrations/home_connect/
Diagnostics information
Example YAML snippet
Anything in the logs that might be useful for us?
2025-03-06 20:36:19.771 INFO (MainThread) [homeassistant.components.home_connect.config_flow] Successfully authenticated
2025-03-06 20:36:19.774 DEBUG (MainThread) [aiohomeconnect] Request: GET /homeappliances
2025-03-06 20:36:19.868 DEBUG (MainThread) [aiohomeconnect] Response:
{
"error": {
"key": "invalid_token",
"description": "The provided token is malformed."
}
}
2025-03-06 20:36:19.868 DEBUG (MainThread) [homeassistant.components.home_connect.coordinator] Finished fetching 01JNPFAWHWHP9YX2Y86ES1HR0N data in 0.094 seconds (success: False)
2025-03-06 20:36:19.868 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Waschtrockner' for home_connect integration could not authenticate: Authentication error: The provided token is malformed. (invalid_token). Please, re-authenticate your account
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 10
- Comments: 70 (30 by maintainers)
This PR works around the issue creating a new separate httpx client for the inexogy integration:
https://github.com/home-assistant/core/pull/141374
It will be included in tomorrow’s beta release of Home Assistant.
If anyone here is not using inexogy, please comment. Then we can continue troubleshooting and looking for integrations that are using httpx under the hood.
But hopefully this was the missing piece and it will be solved in the next release.
Are all of you affected by this issue using the inexogy integration? We found a problem in that integration dependency where it sets auth directly on the shared httpx client.
Installed Core 2025.3.3 and the problem persists. Does anyone have any ideas for a solution? 😦
With Core 2025.4.0, it’s OK! Thanks!
Yes, I am also using that integration.
Yes, I have that Integration in use as well.
Von: Martin Hjelmare @.> Gesendet: Tuesday, March 25, 2025 3:10:06 PM An: home-assistant/core @.> Cc: Martin Grüning @.>; Manual @.> Betreff: Re: [home-assistant/core] Home Connect Auth Error (Issue #139991)
Are all of you affected by this issue using the inexogy integration? We found a problem in that integration dependency where it sets auth directly on the shared httpx client.
— Reply to this email directly, view it on GitHubhttps://github.com/home-assistant/core/issues/139991#issuecomment-2751394840, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIXWEHTETS35YYDFSMF6LTT2WFIS5AVCNFSM6AAAAABYPQZOM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONJRGM4TIOBUGA. You are receiving this because you are subscribed to this thread.Message ID: @.***>
[MartinHjelmare]MartinHjelmare left a comment (home-assistant/core#139991)https://github.com/home-assistant/core/issues/139991#issuecomment-2751394840
Are all of you affected by this issue using the inexogy integration? We found a problem in that integration dependency where it sets auth directly on the shared httpx client.
— Reply to this email directly, view it on GitHubhttps://github.com/home-assistant/core/issues/139991#issuecomment-2751394840, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIXWEHTETS35YYDFSMF6LTT2WFIS5AVCNFSM6AAAAABYPQZOM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONJRGM4TIOBUGA. You are receiving this because you are subscribed to this thread.Message ID: @.***>
I installed Core 2025.3.2 this morning. The problem persists.
Inexogy sets auth directly on the shared httpx client. Both Inexogy and Home Connect integrations use httpx and the shared client.
It will be fixed in the release that goes out tomorrow.
I tried it out, but it looks a little bit different on my side. It is not using the Bearer token:
My bearer token is
Bearer eyJ4LWV[...]FfO4JMAI have the same issue and I can confirm that the token is identical and also works with curl.
Debug Log File:
cat .storage/core.config_entries
curl -X GET “https://api.home-connect.com/api/homeappliances”
-H “Authorization: Bearer eyJ4LWV[…]FfO4JMA”
I hope that helps.
Did you accessed to the Home Assistant container? Access with
(I also updated the above instructions because I forgot to add it)
@MartinHjelmare Sure, result is
b53e1913413087c955c335ff40afcd5d -Btw.: I will be out for the afternoon, so if there’s anything else I can provide, it probably has to wait until the evening, sorry.
I checked a new integration on an older HA Instance on other Device, with same Data and no Problems:
@Diegorro98
A freshly spun up docker container of the version (2025.3.1 - same as I sport on my main homeassistant) presents no issue with Home Connect. Same account, same config, works like a charm.
@MartinHjelmare Thanks for chiming in here, much appreciated.
File contents from my main containers
home_connect/api.pyare identical to the ones posted by you.Given that it works for me on a freshly spun up HA Container instance, I think it’s likely that some
custom_componentpresents a culprit here. The contents of mycustom_componentsfolder (I do sport 36 custom integrations) seem quite unassuming. No remnants of the previoushome_connectcustom component there.Any idea on what to
grepfor (and where) i.e. in order to figure out if another component is overwriting the domain?@Diegorro98 Looks, more or less, identical to me 😕
I’ve also gone ahead and used
python -m aiohomeconnect get-appliances <client_id> <client_secret>, that also works as expected, so I don’t believe the problem is with theaiohomeconnectlibrary:In English, “you” can be used for both the second person singular and plural. In this case, it was plural.
Well, 3 users have the problem here. So he is not alone. And I would like to bet that many have simply not yet reported the problem.
I spend a few minutes on investigating the issue.
So, I reauthenticated via the Home Assitant integration page & as with all tries before, immediately after reauthenticating, Home Assistant tells me that:
The provided token is malformed. (invalid_token)I then extracted the access token from my
core.config_entriesand checked it via https://jwt.io/ The resulting decoded token contents look fine:Header
Payload
I then went ahead and used that token to make a
curlrequest to the Home Connect Api to list my appliancesUnsurprisingly, that worked as well:
While checking the
core.config_entriesI noticed something in the Home Connect entry that, I know from experience, can throw off some timestamp parsers and that is the decimal point in theexpires_atentry which presents itself in the JSON like this:"expires_at":1741443881.8314924. While being spec compliant, I remember that exactly this did throw a Go application off while parsing something similar. Just a hunch & it does not really correspond with the error message that presents itself in the logs, but yeah, could be something, might be nothing.Unfortunately, I also have exactly the same error. I can also authenticate myself successfully, but then I immediately receive an authentication error. Unfortunately, the core update I just installed didn’t solve the problem either.
@ugath @Diegorro98 I do have the same issue since updating to 2025.3; I’ve been through the same troubleshooting steps as @ugath, also with no success.
I did not make any changes to my Home Connect Developer Portal Config or the Home Assistant Integration Config before the error appeared.
I’ll check Swagger over the weekend, to see if I’m able to get any more information out of this.