{"record":{"id":"3e730e4a53f8e81a","repo":"home-assistant/core","slug":"invalidauth","errorCode":null,"errorMessage":"InvalidAuth","messagePattern":"InvalidAuth","errorType":"exception","errorClass":"InvalidAuth","httpStatus":null,"severity":"error","filePath":"homeassistant/components/blink/config_flow.py","lineNumber":32,"sourceCode":"    ConfigFlow,\n    ConfigFlowResult,\n)\nfrom homeassistant.const import CONF_PASSWORD, CONF_PIN, CONF_USERNAME\nfrom homeassistant.core import callback\nfrom homeassistant.exceptions import HomeAssistantError\nfrom homeassistant.helpers.aiohttp_client import async_get_clientsession\n\nfrom .const import DOMAIN, HARDWARE_ID\n\n_LOGGER = logging.getLogger(__name__)\n\n\nasync def validate_input(blink: Blink) -> None:\n    \"\"\"Validate the user input allows us to connect.\"\"\"\n    try:\n        result = await blink.start()\n    except (LoginError, TokenRefreshFailed) as err:\n        raise InvalidAuth from err\n    if result is False:\n        raise InvalidAuth\n\n\nasync def _send_blink_2fa_pin(blink: Blink, pin: str | None) -> None:\n    \"\"\"Send 2FA pin to blink servers.\"\"\"\n    if not await blink.send_2fa_code(pin):\n        raise InvalidAuth\n\n\nclass BlinkConfigFlow(ConfigFlow, domain=DOMAIN):\n    \"\"\"Handle a Blink config flow.\"\"\"\n\n    VERSION = 4\n\n    def __init__(self) -> None:\n        \"\"\"Initialize the blink flow.\"\"\"\n        self.auth: Auth | None = None","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/blink/config_flow.py#L14-L50","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-enter email and password carefully in the flow (watch for app-specific password requirements or typos).","If 2FA is enabled, request a new pin and submit it promptly — pins expire quickly.","Check the python-blink-library issue tracker for cloud-side auth breakages; update HA so the pinned library version is current.","Log in to the Blink mobile app with the same credentials to confirm the account itself is healthy (not locked).","Avoid starting the flow on multiple devices simultaneously — parallel logins can invalidate tokens."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = await blink.start()\nexcept (LoginError, TokenRefreshFailed) as err:\n    raise InvalidAuth from err\nif result is False:\n    raise InvalidAuth","preventionTips":["Verify credentials in the official Blink app before configuring HA.","Complete 2FA promptly — pins expire; request a fresh one per attempt.","Avoid concurrent logins from multiple tools; they invalidate refresh tokens."],"tags":["home-assistant","blink","authentication","config-flow","cloud"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}