mirror of
https://github.com/home-assistant/core.git
synced 2026-07-07 23:06:34 +01:00
6a51b21242
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
27 lines
814 B
Python
27 lines
814 B
Python
"""Application credentials platform for the Yoto integration."""
|
|
|
|
from homeassistant.components.application_credentials import ClientCredential
|
|
from homeassistant.core import HomeAssistant
|
|
from homeassistant.helpers.config_entry_oauth2_flow import (
|
|
LocalOAuth2ImplementationWithPkce,
|
|
)
|
|
|
|
AUTHORIZE_URL = "https://login.yotoplay.com/authorize"
|
|
TOKEN_URL = "https://login.yotoplay.com/oauth/token"
|
|
|
|
|
|
async def async_get_auth_implementation(
|
|
hass: HomeAssistant,
|
|
auth_domain: str,
|
|
credential: ClientCredential,
|
|
) -> LocalOAuth2ImplementationWithPkce:
|
|
"""Return a Yoto OAuth2 implementation with PKCE."""
|
|
return LocalOAuth2ImplementationWithPkce(
|
|
hass,
|
|
auth_domain,
|
|
credential.client_id,
|
|
AUTHORIZE_URL,
|
|
TOKEN_URL,
|
|
credential.client_secret,
|
|
)
|