{"record":{"id":"b61ba9b54bbd33c7","repo":"home-assistant/core","slug":"no-application-credentials-platform-for-domain","errorCode":null,"errorMessage":"No application_credentials platform for {domain}","messagePattern":"No application_credentials platform for (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/application_credentials/__init__.py","lineNumber":94,"sourceCode":"class AuthorizationServer:\n    \"\"\"Represent an OAuth2 Authorization Server.\"\"\"\n\n    authorize_url: str\n    token_url: str\n\n\nclass ApplicationCredentialsStorageCollection(collection.DictStorageCollection):\n    \"\"\"Application credential collection stored in storage.\"\"\"\n\n    CREATE_SCHEMA = vol.Schema(CREATE_FIELDS)\n\n    @override\n    async def _process_create_data(self, data: dict[str, str]) -> dict[str, str]:\n        \"\"\"Validate the config is valid.\"\"\"\n        result = self.CREATE_SCHEMA(data)\n        domain = result[CONF_DOMAIN]\n        if not await _get_platform(self.hass, domain):\n            raise ValueError(f\"No application_credentials platform for {domain}\")\n        return result\n\n    @callback\n    @override\n    def _get_suggested_id(self, info: dict[str, str]) -> str:\n        \"\"\"Suggest an ID based on the config.\"\"\"\n        return f\"{info[CONF_DOMAIN]}.{info[CONF_CLIENT_ID]}\"\n\n    @override\n    async def _update_data(\n        self, item: dict[str, str], update_data: dict[str, str]\n    ) -> dict[str, str]:\n        \"\"\"Return a new updated data object.\"\"\"\n        raise ValueError(\"Updates not supported\")\n\n    @override\n    async def async_delete_item(self, item_id: str) -> None:\n        \"\"\"Delete item, verifying credential is not in use.\"\"\"","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/application_credentials/__init__.py#L76-L112","documentation":"Raised by ApplicationCredentialsStorageCollection._process_create_data when a client credential is created for an integration domain that does not implement the application_credentials platform. Home Assistant only stores OAuth client credentials for integrations that declare their authorization server via a components/<domain>/application_credentials.py module. Creating a credential for any other domain is rejected with this ValueError.","triggerScenarios":"Calling the websocket command application_credentials/create (or YAML import via async_import_item) with a 'domain' field whose integration has no application_credentials.py platform. Also triggered when _get_platform(hass, domain) returns None because the integration is not loaded or has no async_get_authorization_server implementation.","commonSituations":"Typos in the domain field when creating credentials through a websocket/API client; attempting to add OAuth app credentials for an integration that only supports config-flow auth without application credentials; a custom integration missing the application_credentials platform; the domain from a config entry that was set up before OAuth support was added.","solutions":["Verify the integration actually supports application credentials: check that homeassistant/components/<domain>/application_credentials.py exists (or the integration docs mention setting up an 'Application Credentials' helper).","Fix the domain value in the create request to match a supported integration's domain exactly.","If you develop the integration, add an application_credentials.py module with async_get_authorization_server() (and async_get_auth_implementation() if needed).","If the platform file exists but the integration is not loaded, load the integration first (e.g. via config flow) so _get_platform resolves."],"exampleFix":"# custom_components/my_integration/application_credentials.py\nfrom homeassistant.core import HomeAssistant\nfrom homeassistant.components.application_credentials import AuthorizationServer, ClientCredential, async_register_client_credential\n\nasync def async_get_authorization_server(hass: HomeAssistant) -> AuthorizationServer:\n    return AuthorizationServer(\n        authorize_url=\"https://example.com/oauth/authorize\",\n        token_url=\"https://example.com/oauth/token\",\n    )","handlingStrategy":"validation","validationCode":"from homeassistant.helpers import config_validation as cv\nfrom homeassistant.components.application_credentials import async_get_application_credentials\nfrom homeassistant.loader import async_get_integration\n\nasync def domain_supports_app_credentials(hass, domain: str) -> bool:\n    integration = await async_get_integration(hass, domain)\n    return (integration.file_path / \"application_credentials.py\").exists()","typeGuard":null,"tryCatchPattern":"try:\n    await collection.async_create_item({\"domain\": domain, \"client_id\": cid, \"client_secret\": secret})\nexcept ValueError as err:\n    if \"No application_credentials platform\" in str(err):\n        # surface to user: integration lacks OAuth app credential support\n        raise","preventionTips":["Before creating a credential, confirm the integration ships an application_credentials.py platform.","Spell the domain exactly as the integration directory name.","In custom integrations, implement async_get_authorization_server so the platform resolves."],"tags":["home-assistant","oauth","application-credentials","integration-setup","validation"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}