By default to use access_token if hass.auth.active (#15212)
* Force to use access_token if hass.auth.active * Not allow Basic auth with api_password if hass.auth.active * Block websocket api_password auth when hass.auth.active * Add legacy_api_password auth provider * lint * lint
This commit is contained in:
1 parent
279fd39677
commit
63b28aa39d
8 files changed
+468
-83
No files matched your search
@@ -184,7 +184,22 @@ class HomeAssistantHTTP(object):
|
||||
if is_ban_enabled:
|
||||
setup_bans(hass, app, login_threshold)
|
||||
|
||||
setup_auth(app, trusted_networks, api_password)
|
||||
if hass.auth.active:
|
||||
if hass.auth.support_legacy:
|
||||
_LOGGER.warning("Experimental auth api enabled and "
|
||||
"legacy_api_password support enabled. Please "
|
||||
"use access_token instead api_password, "
|
||||
"although you can still use legacy "
|
||||
"api_password")
|
||||
else:
|
||||
_LOGGER.warning("Experimental auth api enabled. Please use "
|
||||
"access_token instead api_password.")
|
||||
elif api_password is None:
|
||||
_LOGGER.warning("You have been advised to set http.api_password.")
|
||||
|
||||
setup_auth(app, trusted_networks, hass.auth.active,
|
||||
support_legacy=hass.auth.support_legacy,
|
||||
api_password=api_password)
|
||||
|
||||
if cors_origins:
|
||||
setup_cors(app, cors_origins)
|
||||
|
||||
Reference in new issue
Block a user