Basic Auth for web_server component (#304)

* Basic auth

* Basic auth

* typo

* Update web_server.rst

* Move auth example out of top-level example

Reason: Most users will copy-paste that into their config directly, which then causes a validation error because of the missing !secret value.


Co-authored-by: Otto Winter <otto@otto-winter.com>
This commit is contained in:
Nikolay Vasilchuk 2019-10-13 15:28:02 +03:00 committed by Otto Winter
parent 92975768af
commit e91a665ba4
1 changed files with 15 additions and 1 deletions

View File

@ -38,11 +38,25 @@ Configuration variables:
to https://esphome.io/_static/webserver-v1.min.css (updates will go to ``v2``, ``v3``, etc).
- **js_url** (*Optional*, url): The URL that should be used for the JS script. Defaults
to https://esphome.io/_static/webserver-v1.min.js.
- **auth** (*Optional*): Enables basic authentication with username and password.
- **username** (**Required**, string): The username to use for authentication.
- **password** (**Required**, string): The password to check for authentication.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
.. note::
Starting with version 1.9.0, you can also upload firmware files OTA with the web server.
Example web_server configuration using HTTP authentication:
.. code-block:: yaml
# Example configuration entry
web_server:
port: 80
auth:
username: admin
password: !secret web_server_password
See Also
--------