mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00

* Include the redirect URL in the Google Drive instructions * Apply suggestions from code review Co-authored-by: Martin Hjelmare <marhje52@gmail.com> --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
24 lines
1021 B
Python
24 lines
1021 B
Python
"""application_credentials platform for Google Drive."""
|
|
|
|
from homeassistant.components.application_credentials import AuthorizationServer
|
|
from homeassistant.core import HomeAssistant
|
|
from homeassistant.helpers import config_entry_oauth2_flow
|
|
|
|
|
|
async def async_get_authorization_server(hass: HomeAssistant) -> AuthorizationServer:
|
|
"""Return authorization server."""
|
|
return AuthorizationServer(
|
|
"https://accounts.google.com/o/oauth2/v2/auth",
|
|
"https://oauth2.googleapis.com/token",
|
|
)
|
|
|
|
|
|
async def async_get_description_placeholders(hass: HomeAssistant) -> dict[str, str]:
|
|
"""Return description placeholders for the credentials dialog."""
|
|
return {
|
|
"oauth_consent_url": "https://console.cloud.google.com/apis/credentials/consent",
|
|
"more_info_url": "https://www.home-assistant.io/integrations/google_drive/",
|
|
"oauth_creds_url": "https://console.cloud.google.com/apis/credentials",
|
|
"redirect_url": config_entry_oauth2_flow.async_get_redirect_uri(hass),
|
|
}
|