home-assistant/core · error · ConfigEntryAuthFailed
Authentication failed, please check credentials
Error message
Authentication failed, please check credentials
What it means
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.
Source
Thrown at homeassistant/components/autoskope/__init__.py:32
PLATFORMS: list[Platform] = [Platform.DEVICE_TRACKER]
async def async_setup_entry(hass: HomeAssistant, entry: AutoskopeConfigEntry) -> bool:
"""Set up Autoskope from a config entry."""
session = async_create_clientsession(hass, cookie_jar=aiohttp.CookieJar())
api = AutoskopeApi(
host=entry.data.get(CONF_HOST, DEFAULT_HOST),
username=entry.data[CONF_USERNAME],
password=entry.data[CONF_PASSWORD],
session=session,
)
try:
await api.connect()
except InvalidAuth as err:
raise ConfigEntryAuthFailed(
"Authentication failed, please check credentials"
) from err
except CannotConnect as err:
raise ConfigEntryNotReady("Could not connect to Autoskope API") from err
coordinator = AutoskopeDataUpdateCoordinator(hass, api, entry)
await coordinator.async_config_entry_first_refresh()
entry.runtime_data = coordinator
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: AutoskopeConfigEntry) -> bool:
"""Unload a config entry."""
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)View on GitHub (pinned to 58a3fdb3ea)
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.
Defensive patterns
Strategy: try-catch
Try / catch
from homeassistant.exceptions import ConfigEntryAuthFailed
try:
await api.connect()
except ConfigEntryAuthFailed:
# surface re-auth UI to the user; do not retry with the same credentials
raise Prevention
- 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.
When it happens
Trigger: 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.
Common situations: User changed their Autoskope portal password after initial setup; typo during config flow; token/session invalidated server-side.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- Invalid authentication
- Could not connect to Autoskope API
- Authentication failed: {reauth_err}
- authentication_failed
- Credential is already linked to a user
AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14).
Data as JSON: /api/errors/cca7c3d6aa01a40a.
Report an issue: GitHub.