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
71.06k stars 29.73k forks source link

Blink Integration - Login to Endpoint fails, unable to refresh token #115733

Closed schuss closed 1 month ago

schuss commented 4 months ago

The problem

The endpoint doesn't seem to be down, so I don't think it's an outage. I still see a response at the base endpoint: https://rest-prod.immedia-semi.com/ But login is failing and the login URL that's used in the integration doesn't seem like it's valid: https://rest-prod.immedia-semi.com/api/v5/account/login

This is a different error than the previous issue: https://github.com/home-assistant/core/issues/111941 but I can't tell if it's related.

What version of Home Assistant Core has the issue?

core-2024.4.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

BLINK

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-04-16 22:08:00.524 DEBUG (MainThread) [blinkpy.helpers.util] Setting base url to https://rest-u021.immedia-semi.com.
2024-04-16 22:08:00.524 DEBUG (MainThread) [blinkpy.api] Making GET request to https://rest-u021.immedia-semi.com/api/v3/accounts/151797/homescreen
2024-04-16 22:08:00.821 INFO (MainThread) [blinkpy.auth] Token expired, attempting automatic refresh.
2024-04-16 22:08:00.821 INFO (MainThread) [blinkpy.auth] Attempting login with https://rest-prod.immedia-semi.com/api/v5/account/login
2024-04-16 22:08:00.983 ERROR (MainThread) [blinkpy.auth] Login endpoint failed. Try again later.
2024-04-16 22:08:00.983 ERROR (MainThread) [blinkpy.auth] Unable to refresh token.

Additional information

No response

home-assistant[bot] commented 4 months ago

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

Code owner commands Code owners of `blink` 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 blink` 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)


blink documentation blink source (message by IssueLinks)

code-to-core commented 4 months ago

Hi, same issue here. Started getting 2FA texts from Blink at 2:51am and got an email from blink saying a new login was being attempted from my existing HA instance.

I tried to set the new PIN using the service but HA said invalid config_entry. Then I deleted and tried to re-add the integration and HA fails to log in with a bad-authentication message.

Blink app on my phone is still working fine, and also I have no issue on a second HA instance using the same creds.

GabrieleCastellani commented 4 months ago

I have exactly the same situation

schuss commented 4 months ago

Yes, I'm getting the 2FA texts and email alerts also.

It seems like the integration is not able to trigger a re-login event properly and complete authentication, but it's attempting it and reaching a Blink endpoint enough to kick off the 2FA.

mkmer commented 4 months ago

After it failed, did it kick off a reauth flow? After a complete remove/reinstall did you get the 2FA flow or no? At the moment, I am not having this problem so others will need to help us debug what has broke in the 2FA flow.

code-to-core commented 4 months ago

I retried exactly the same thing as earlier today (re-adding the integration) and this time it worked. Since My other HA instance never had an issue with the same credentials it seems like it was a transient issue at Blink.

I would love to know if other's just started working again without re-adding the integration.

paragchandra commented 4 months ago

Same issue since this morning. I keep getting 2FA codes on my phone, so I removed and re-added the Blink integration, using the most recent 2FA code, and that got things working again. However, after another hour or two, I started getting the codes again.

issDaemon commented 4 months ago

I am having this same issue. In my case, it de-authed me from the app on my phone as well, but the only error I got out of the Android app was "authentication failed" any time I tried to access settings to try to change password. I think what triggered the failure for me was when I restarted HA this morning, the Blink integration tried to authenticate after restart, got the 2FA request, and couldn't deal with it. I tried multiple times to configure or reload the integration, and only met with failures as above. I finally uninstalled and reinstalled the app on my phone, in an attempt to get anything working, and got the error:

Login limit exceeded. Please disable any 3rd party automation and try again in 60 minutes.

So, it seems that the Blink integration constantly trying to login over and over locked out my account, which compounded the issue for me. I think the primary problem is some bug with the HA Blink integration handling the 2FA request from the Blink servers, after initial configuration, since it works for first-time setup just fine. I am still in the lockout window, so I am going to try the Android app first to make sure my account lockout has expired, and then I'll try to reinstall the Blink integration. I had to manually remove it by editing /config/.storage/core.config_entries, as I could not delete the integration from the UI, and it was continually spamming the Blink servers.

issDaemon commented 4 months ago

Well, I got the Android app reconnected, but the HA integration still fails. I completely removed the integration and tried to reinstall, but I keep getting this error:

Invalid Authentication

I know the user/pass are correct as I just used them to install the Android app. Further, I have another HA install that is connected to the same Ring account just fine. I'm giving up for now. My bet is that Amazon made some update to the API to break 3rd party apps.

paragchandra commented 4 months ago

Upgrading to a newer HA (2023.something -> 2024.4.3) fixed this issue for me. No more 2FA messages from Blink, and the integration is working correctly again.

Mike-FromIT commented 4 months ago

Upgrading to a newer HA (2023.something -> 2024.4.3) fixed this issue for me. No more 2FA messages from Blink, and the integration is working correctly again.

This issue only showed up for me after updating to 2024.4.4

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