From 7acbe01b38e4b37ac92bfafe63e1cc115b03d75c Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Tue, 5 Apr 2022 15:14:20 +0000 Subject: [PATCH] Update documentation to explain the import API --- docs/core/platform/application_credentials.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/core/platform/application_credentials.md b/docs/core/platform/application_credentials.md index f69eef58..286cb592 100644 --- a/docs/core/platform/application_credentials.md +++ b/docs/core/platform/application_credentials.md @@ -26,16 +26,10 @@ async def async_get_authorization_server( authorize_url="https://example.com/auth", token_url="https://example.com/oauth2/v4/token" ) - - -# Optional and provided only for backwards compatibility if integration used to -# accept YAML credentials. Return YAML client ID and secret. -async def async_get_client_credential( - self, hass: HomeAssistant -) -> ClientCredential: - """Return a client credential from configuration.yaml.""" ``` +See below for details on backwards compatibility with YAML credentials. + ## AuthorizationServer A `AuthorizationServer` represents the [OAuth2 Authorization server](https://datatracker.ietf.org/doc/html/rfc6749) used for an integration. @@ -45,6 +39,12 @@ A `AuthorizationServer` represents the [OAuth2 Authorization server](https://dat | authorize_url | str | **Required** | The OAuth authorize URL that the user is redirected to during the configuration flow. | | token_url | str | **Required** | The URL used for obtaining an access token. | +## Import YAML credentials + +Credentials may be imported by integrations that used to accept YAML credentials using the import API `async_import_client_credential` provided by the application credentials integration. + +The `auth_domain` is the domain for the auth implementation in in the config entry, which is typically the domain specified in an existing `LocalOAuth2Implementation`. + ## ClientCredential A `ClientCredential` represents the a client credential provided by the user.