mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 10:13:52 -05:00
Send the SmartThings token request credentials as a header
aiohttp deprecates BasicAuth and the per-request auth argument in favour of encode_basic_auth() plus an Authorization header. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PRmnu5HiXQUaHcHnNCvBSU
This commit is contained in:
@@ -4,7 +4,7 @@ from json import JSONDecodeError
|
||||
import logging
|
||||
from typing import cast, override
|
||||
|
||||
from aiohttp import BasicAuth, ClientError
|
||||
from aiohttp import ClientError, encode_basic_auth
|
||||
|
||||
from homeassistant.components.application_credentials import (
|
||||
AuthImplementation,
|
||||
@@ -46,7 +46,9 @@ class SmartThingsOAuth2Implementation(AuthImplementation):
|
||||
resp = await session.post(
|
||||
self.token_url,
|
||||
data=data,
|
||||
auth=BasicAuth(self.client_id, self.client_secret),
|
||||
headers={
|
||||
"Authorization": encode_basic_auth(self.client_id, self.client_secret)
|
||||
},
|
||||
)
|
||||
if resp.status >= 400:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user