home-assistant/core · error · HomeAssistantError
Unable to load auth provider {provider}: {err}
Error message
Unable to load auth provider {provider}: {err} What it means
Raised as HomeAssistantError by load_auth_provider_module (homeassistant/auth/providers/__init__.py:172) when importing homeassistant.auth.providers.{provider} fails with ImportError. The provider string comes from the `type:` key of each entry under homeassistant.auth_providers in configuration.yaml; an unknown/renamed type triggers this. The ImportError is logged and chained via `from err`.
Source
Thrown at homeassistant/auth/providers/__init__.py:172
provider_name,
humanize_error(config, err),
)
raise
return AUTH_PROVIDERS[provider_name](hass, store, config)
async def load_auth_provider_module(
hass: HomeAssistant, provider: str
) -> types.ModuleType:
"""Load an auth provider."""
try:
module = await async_import_module(
hass, f"homeassistant.auth.providers.{provider}"
)
except ImportError as err:
_LOGGER.error("Unable to load auth provider %s: %s", provider, err)
raise HomeAssistantError(
f"Unable to load auth provider {provider}: {err}"
) from err
if hass.config.skip_pip or not hasattr(module, "REQUIREMENTS"):
return module
if (processed := hass.data.get(DATA_REQS)) is None:
processed = hass.data[DATA_REQS] = set()
elif provider in processed:
return module
reqs = module.REQUIREMENTS
await requirements.async_process_requirements(
hass, f"auth provider {provider}", reqs
)
processed.add(provider)
return moduleView on GitHub (pinned to 58a3fdb3ea)
Solutions
- Correct the `type:` value to a registered provider (homeassistant, trusted_networks, command_line, legacy_api_password if still supported)
- Check the preceding log line 'Unable to load auth provider %s: %s' for the real ImportError detail
- Remove obsolete provider blocks after a version upgrade and restart
Example fix
# before (configuration.yaml)
homeassistant:
auth_providers:
- type: legacy_api_password # removed in newer versions
# after
homeassistant:
auth_providers:
- type: homeassistant Defensive patterns
Strategy: validation
Validate before calling
from homeassistant.auth import providers
assert provider_type in providers.AUTH_PROVIDERS, f"unknown provider {provider_type}" Type guard
def provider_registered(provider_type: str) -> bool:
from homeassistant.auth import providers
return provider_type in providers.AUTH_PROVIDERS Try / catch
from homeassistant.exceptions import HomeAssistantError
try:
await providers.load_auth_provider_module(hass, provider)
except HomeAssistantError as err:
if not str(err).startswith("Unable to load auth provider"):
raise Prevention
- After upgrading, review release notes for removed auth providers (e.g. legacy_api_password)
- Use `hass --script check_config` to validate auth_providers sections
- Keep the ImportError context from the log — it often points to a missing dependency
When it happens
Trigger: configuration.yaml has homeassistant.auth_providers with type: legacy_api_password after it was removed; typo like type: homeassistant_Provider; referencing a custom provider package that no longer exists or fails to import.
Common situations: Upgrading Home Assistant past a provider removal (e.g. legacy_api_password dropped in 2025.x); stale config from old tutorials; custom component providers whose import raises.
Related errors
- Unable to load mfa module {module_name}: {err}
- trusted_networks is not configured
- User is not active
- System generated users cannot have refresh tokens connected
- System generated users can only have system type refresh tok
AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14).
Data as JSON: /api/errors/23338afc42950cc4.
Report an issue: GitHub.