home-assistant/core

Withings needs reauthentication very often

backslashV opened this issue · 16 comments

The problem

The Withings integration needs constant reauth. My Withings account has 3 users. I was looking at this issue and thought that it was resolved, but it seems it's still here.
From the logs:

Uncaught error from Chrome WebView 129.0.6668.81 on Android 14 ReferenceError: Polymer is not defined Object.<anonymous> (/local/lovelace/resources/custom-ui/custom-ui.js:2205:13) s (/local/lovelace/resources/custom-ui/custom-ui.js:15:21) /local/lovelace/resources/custom-ui/custom-ui.js:47:5 /local/lovelace/resources/custom-ui/custom-ui.js:49:1
Uncaught error from Chrome 129.0.0.0 on Windows 10 ReferenceError: Polymer is not defined Object.<anonymous> (/local/lovelace/resources/custom-ui/custom-ui.js:2205:13) s (/local/lovelace/resources/custom-ui/custom-ui.js:15:21) /local/lovelace/resources/custom-ui/custom-ui.js:47:5 /local/lovelace/resources/custom-ui/custom-ui.js:49:1
Uncaught error from Chrome WebView 129.0.6668.100 on Android 14 ReferenceError: Polymer is not defined Object.<anonymous> (/local/lovelace/resources/custom-ui/custom-ui.js:2205:13) s (/local/lovelace/resources/custom-ui/custom-ui.js:15:21) /local/lovelace/resources/custom-ui/custom-ui.js:47:5 /local/lovelace/resources/custom-ui/custom-ui.js:49:1
Failed to format translation for key 'component.withings.config.step.reauth_confirm.title' in language 'en'. Error: The intl string context variable "name" was not provided to the string "Authentication expired for {name}"
Uncaught error from Chrome WebView 129.0.6668.100 on Android 15 ReferenceError: Polymer is not defined Object.<anonymous> (/local/lovelace/resources/custom-ui/custom-ui.js:2205:13) s (/local/lovelace/resources/custom-ui/custom-ui.js:15:21) /local/lovelace/resources/custom-ui/custom-ui.js:47:5 /local/lovelace/resources/custom-ui/custom-ui.js:49:1

Authentication failed while fetching Withings 19932223 measurements data: An unknown error occurred

What version of Home Assistant Core has the issue?

core-2024.9.3

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

Withings

Link to integration documentation on our website

https://www.home-assistant.io/integrations/withings

Diagnostics information

config_entry-withings-01J9ZBMDB1T602DN0AVCF915CK.json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

Hey there @joostlek, mind taking a look at this issue as it has been labeled with an integration (withings) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of withings 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 withings 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)


withings documentation
withings source
(message by IssueLinks)

Does this one happen to one of the users or all of the users?

Only I have added my Withings account to HA.

So wait, in the app you have 3 users, but you only added one to Home Assistant?

I apologize. The app also isn't showing any other members in the Family section. However, 2 other persons are using the scale, and they have their own accounts which are not added to HA.

Okay, so that means we just have 1 account that just does reauth.

Have you tried getting new client credentials and setting up the integration again? That helps sometimes

I haven't tried generating new credentials. I simply reauth, the integration works for a few days, and then requires reauth again.

Yep, that's strange as it does refresh in the meantime.

One thing that you could try is check if they responded more data in the token response. If you wait a few moments before deleting I can cook up a script for you

Oh, I went ahead and generated new credentials and removed the integration, but I'd be happy to test with your script.

I am trying to add the integration again, but it's taking me to the old dev portal app. I can tell because I am using different logos for the old and new apps. Moreover, it's not asking me to enter the newly generated credentials anywhere. Any ideas?

Thanks a lot. Meanwhile, if I need to test anything with your script, please let me know.

I have experienced that withings can return extra info in the token if it failed to refresh for some reason, which would be stored in HA. But if you now removed that, that doesn't exist anymore. So let's see if this worked

I have the same problem here. I have 4 people under one account and have to re-authenticate the integration several times a month

Same here. Maybe this is related to re-auth needs for iCloud and Tuya integrations as well?

IMG_4034

Ph4n70 commented

Apparently this is related to the Apple certificate which expired yesterday (same issue with other integrations :
"Looks like the digital certificate for apple.com might have just been updated. It says Not valid before Saturday 19 October 2024 at 04:00:26 Australian Eastern Daylight Time, which was early this morning here."
Source