{"record":{"id":"cca7c3d6aa01a40a","repo":"home-assistant/core","slug":"authentication-failed-please-check-credentials","errorCode":null,"errorMessage":"Authentication failed, please check credentials","messagePattern":"Authentication failed, please check credentials","errorType":"exception","errorClass":"ConfigEntryAuthFailed","httpStatus":null,"severity":"error","filePath":"homeassistant/components/autoskope/__init__.py","lineNumber":32,"sourceCode":"\nPLATFORMS: list[Platform] = [Platform.DEVICE_TRACKER]\n\n\nasync def async_setup_entry(hass: HomeAssistant, entry: AutoskopeConfigEntry) -> bool:\n    \"\"\"Set up Autoskope from a config entry.\"\"\"\n    session = async_create_clientsession(hass, cookie_jar=aiohttp.CookieJar())\n\n    api = AutoskopeApi(\n        host=entry.data.get(CONF_HOST, DEFAULT_HOST),\n        username=entry.data[CONF_USERNAME],\n        password=entry.data[CONF_PASSWORD],\n        session=session,\n    )\n\n    try:\n        await api.connect()\n    except InvalidAuth as err:\n        raise ConfigEntryAuthFailed(\n            \"Authentication failed, please check credentials\"\n        ) from err\n    except CannotConnect as err:\n        raise ConfigEntryNotReady(\"Could not connect to Autoskope API\") from err\n\n    coordinator = AutoskopeDataUpdateCoordinator(hass, api, entry)\n    await coordinator.async_config_entry_first_refresh()\n\n    entry.runtime_data = coordinator\n\n    await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)\n\n    return True\n\n\nasync def async_unload_entry(hass: HomeAssistant, entry: AutoskopeConfigEntry) -> bool:\n    \"\"\"Unload a config entry.\"\"\"\n    return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/autoskope/__init__.py#L14-L50","documentation":"Raised as ConfigEntryAuthFailed from the Autoskope integration's async_setup_entry when api.connect() throws InvalidAuth, meaning the Autoskope API rejected the stored username/password. Home Assistant responds by starting the re-auth config flow and marking the entry as needing re-authorization instead of retrying setup.","triggerScenarios":"Calling AutoskopeApi.connect() (an authenticate() round trip) with credentials that the Autoskope cloud service rejects: wrong username/password in entry.data, password changed on the account, or the account was deleted.","commonSituations":"User changed their Autoskope portal password after initial setup; typo during config flow; token/session invalidated server-side.","solutions":["Follow the re-auth prompt in Home Assistant (Settings > Devices > the Autoskope entry > Re-authenticate) and re-enter correct credentials.","Verify the same credentials work by logging into the Autoskope app/portal.","Check the config entry data keys CONF_USERNAME/CONF_PASSWORD are populated and not empty."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from homeassistant.exceptions import ConfigEntryAuthFailed\n\ntry:\n    await api.connect()\nexcept ConfigEntryAuthFailed:\n    # surface re-auth UI to the user; do not retry with the same credentials\n    raise","preventionTips":["Test credentials against the Autoskope portal before configuring the integration.","Treat ConfigEntryAuthFailed as permanent: never catch-and-retry it in setup code.","Rotate the password in HA promptly whenever it changes upstream."],"tags":["home-assistant","authentication","config-entry","autoskope"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}