{"record":{"id":"ae2fc2ba386fdaa5","repo":"home-assistant/core","slug":"auth-expired","errorCode":"auth_expired","errorMessage":"Authentication token expired","messagePattern":"Authentication token expired","errorType":"exception","errorClass":"ConfigEntryAuthFailed","httpStatus":null,"severity":"critical","filePath":"homeassistant/components/anglian_water/__init__.py","lineNumber":57,"sourceCode":"    auth = MSOB2CAuth(\n        username=entry.data[CONF_USERNAME],\n        password=entry.data[CONF_PASSWORD],\n        session=async_create_clientsession(\n            hass,\n            cookie_jar=CookieJar(quote_cookie=False),\n        ),\n        refresh_token=entry.data[CONF_ACCESS_TOKEN],\n    )\n    try:\n        await auth.send_refresh_request()\n    except ConsentRequiredError as err:\n        async_create_consent_required_issue(hass, entry.data[CONF_ACCOUNT_NUMBER])\n        raise ConfigEntryNotReady(\n            translation_domain=DOMAIN,\n            translation_key=\"consent_required\",\n        ) from err\n    except (ExpiredAccessTokenError, InvalidGrantError, SelfAssertedError) as err:\n        raise ConfigEntryAuthFailed(\n            translation_domain=DOMAIN,\n            translation_key=\"auth_expired\",\n        ) from err\n\n    _aw = AnglianWater(authenticator=auth)\n\n    try:\n        await _aw.validate_smart_meter(entry.data[CONF_ACCOUNT_NUMBER])\n    except SmartMeterUnavailableError as err:\n        raise ConfigEntryError(\n            translation_domain=DOMAIN, translation_key=\"smart_meter_unavailable\"\n        ) from err\n\n    hass.config_entries.async_update_entry(\n        entry, data={**entry.data, CONF_ACCESS_TOKEN: auth.refresh_token}\n    )\n    entry.runtime_data = coordinator = AnglianWaterUpdateCoordinator(\n        hass=hass, api=_aw, config_entry=entry","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/anglian_water/__init__.py#L39-L75","documentation":"Raised as ConfigEntryAuthFailed (translation auth_expired) when the token refresh fails with ExpiredAccessTokenError, InvalidGrantError, or SelfAssertedError. The stored refresh token is dead, so HA starts the re-authentication flow and shows the entry as requiring relogin; no amount of retrying will fix it.","triggerScenarios":"auth.send_refresh_request() with a revoked, expired, or single-use-already-consumed refresh token; the IdP returns invalid_grant or the self-asserted flow rejects the account.","commonSituations":"User resetting their Anglian Water password, tokens invalidated by the provider after long HA downtime, or the same credentials used in another tool consuming the single-use refresh token.","solutions":["Open the integration entry in HA and complete the re-authenticate flow with fresh credentials.","Avoid running a second instance (e.g. test setup) with the same account, which burns refresh tokens.","If it recurs immediately after re-auth, check the account on the Anglian Water portal for locks/verification requirements."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"ConfigEntryAuthFailed triggers HA's reauth flow — respond to the reauth prompt instead of catching/retrying; retry cannot recover a dead refresh token.","preventionTips":["Run only one HA instance per Anglian Water account.","Re-authenticate after password resets instead of waiting for failures."],"tags":["auth","oauth","water","reauth","config-entry-auth-failed"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}