home-assistant/core · error · InvalidAuth

InvalidAuth

Error message

InvalidAuth

What it means

InvalidAuth is the config-flow auth error raised by the blink integration's validate_input: awaiting blink.start() threw LoginError or TokenRefreshFailed from the python-blink-library (credentials rejected by Blink's cloud, or the stored token could not be refreshed), or start() completed but returned False (login did not succeed without raising). The config flow then re-prompts for credentials.

Source

Thrown at homeassistant/components/blink/config_flow.py:32

    ConfigFlow,
    ConfigFlowResult,
)
from homeassistant.const import CONF_PASSWORD, CONF_PIN, CONF_USERNAME
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.aiohttp_client import async_get_clientsession

from .const import DOMAIN, HARDWARE_ID

_LOGGER = logging.getLogger(__name__)


async def validate_input(blink: Blink) -> None:
    """Validate the user input allows us to connect."""
    try:
        result = await blink.start()
    except (LoginError, TokenRefreshFailed) as err:
        raise InvalidAuth from err
    if result is False:
        raise InvalidAuth


async def _send_blink_2fa_pin(blink: Blink, pin: str | None) -> None:
    """Send 2FA pin to blink servers."""
    if not await blink.send_2fa_code(pin):
        raise InvalidAuth


class BlinkConfigFlow(ConfigFlow, domain=DOMAIN):
    """Handle a Blink config flow."""

    VERSION = 4

    def __init__(self) -> None:
        """Initialize the blink flow."""
        self.auth: Auth | None = None

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Re-enter email and password carefully in the flow (watch for app-specific password requirements or typos).
  2. If 2FA is enabled, request a new pin and submit it promptly — pins expire quickly.
  3. Check the python-blink-library issue tracker for cloud-side auth breakages; update HA so the pinned library version is current.
  4. Log in to the Blink mobile app with the same credentials to confirm the account itself is healthy (not locked).
  5. Avoid starting the flow on multiple devices simultaneously — parallel logins can invalidate tokens.
Defensive patterns

Strategy: try-catch

Try / catch

try:
    result = await blink.start()
except (LoginError, TokenRefreshFailed) as err:
    raise InvalidAuth from err
if result is False:
    raise InvalidAuth

Prevention

When it happens

Trigger: validate_input(blink) calls `await blink.start()`; Blink cloud returns 401 on login (LoginError), the refresh token is expired/revoked (TokenRefreshFailed), or the library returns False from start(). The separate 2FA helper also raises InvalidAuth when send_2fa_code(pin) is falsy.

Common situations: Wrong email/password, expired 2FA pin or pin requested but not entered in time, Blink cloud token invalidated by repeated logins or Blink server changes (the library is unofficial and breaks periodically), Blink outage returning non-success that the library treats as failed login.

Related errors


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/3e730e4a53f8e81a. Report an issue: GitHub.