{"record":{"id":"c2aab3500a4aad74","repo":"home-assistant/core","slug":"migration-to-oauth-required","errorCode":null,"errorMessage":"Migration to OAuth required","messagePattern":"Migration to OAuth required","errorType":"exception","errorClass":"ConfigEntryAuthFailed","httpStatus":null,"severity":"error","filePath":"homeassistant/components/august/__init__.py","lineNumber":40,"sourceCode":"    ImplementationUnavailableError,\n    OAuth2Session,\n    async_get_config_entry_implementation,\n)\n\nfrom .const import DEFAULT_AUGUST_BRAND, DOMAIN, PLATFORMS\nfrom .data import AugustData\nfrom .gateway import AugustGateway\nfrom .util import async_create_august_clientsession\n\ntype AugustConfigEntry = ConfigEntry[AugustData]\n\n\nasync def async_setup_entry(hass: HomeAssistant, entry: AugustConfigEntry) -> bool:\n    \"\"\"Set up August from a config entry.\"\"\"\n    # Check if this is a legacy config entry that needs migration to OAuth\n    if \"auth_implementation\" not in entry.data:\n        # This is a legacy entry using username/password, trigger reauth\n        raise ConfigEntryAuthFailed(\"Migration to OAuth required\")\n\n    session = async_create_august_clientsession(hass)\n    try:\n        implementation = await async_get_config_entry_implementation(hass, entry)\n    except ImplementationUnavailableError as err:\n        raise ConfigEntryNotReady(\"OAuth implementation not available\") from err\n    oauth_session = OAuth2Session(hass, entry, implementation)\n    august_gateway = AugustGateway(Path(hass.config.config_dir), session, oauth_session)\n    try:\n        await async_setup_august(hass, entry, august_gateway)\n    except OAuth2TokenRequestReauthError as err:\n        raise ConfigEntryAuthFailed from err\n    except (RequireValidation, InvalidAuth) as err:\n        raise ConfigEntryAuthFailed from err\n    except TimeoutError as err:\n        raise ConfigEntryNotReady(\"Timed out connecting to august api\") from err\n    except (\n        AugustApiAIOHTTPError,","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/august/__init__.py#L22-L58","documentation":"ConfigEntryAuthFailed('Migration to OAuth required') raised by August's async_setup_entry when the stored config entry data lacks the 'auth_implementation' key — the signature of a legacy username/password entry created before the integration moved to OAuth. Raising ConfigEntryAuthFailed makes HA immediately put the entry into reauth-setup-failed state and surface a reauthenticate flow to the user.","triggerScenarios":"Upgrading Home Assistant from a version where August used email/password login; importing an old august config entry from a backup; any entry created before the OAuth migration ships.","commonSituations":"Post-upgrade first boot of an HA instance with a long-standing August integration; restored configuration database from an older HA version.","solutions":["Open the reauth prompt (Settings > Devices & Services > August > Reauthenticate) and complete OAuth login with your August/Yale account","If no prompt appears, remove the August entry and set it up fresh","Ensure the account owner can log in to the August app (OAuth requires valid credentials + 2FA device)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if \"auth_implementation\" not in entry.data:\n    # legacy entry: start reauth before attempting setup\n    await hass.config_entries.async_start_reauth(hass, context={\"source\": \"reauth\"})","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Complete OAuth reauth promptly after upgrading HA with legacy August entries","When restoring backups, expect legacy entries to require reauthentication","Do not hand-edit august config entry data to fake OAuth fields"],"tags":["august","oauth","migration","config-entry","auth"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}