mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Updated to include example of using a Bearer token (#9429)
* Updated to include example of using a Bearer token This is the only way I got it to work with a secrets file and I thought it would be useful to share/capture the steps. * Minor changes
This commit is contained in:
parent
6cbcc1acdc
commit
625a07a832
@ -191,6 +191,22 @@ Content-Type: application/json
|
|||||||
User-Agent: Home Assistant
|
User-Agent: Home Assistant
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you are accessing a resource protected by a `Bearer` token in an `Authorization` header, you can either put the token in the header field of the sensor configuration (not recommended) or store the token in your [`secrets.yaml`](/docs/configuration/secrets/) file. In that case, be sure to include the word `Bearer` in the `secrets` file.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
sensor:
|
||||||
|
- platform: rest
|
||||||
|
resource: http://IP_ADDRESS:5000/sensor
|
||||||
|
headers:
|
||||||
|
Authorization: !secret my_sensor_secret_token
|
||||||
|
```
|
||||||
|
|
||||||
|
Example entry for the `secrets.yaml` file:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
my_sensor_secret_token: Bearer gh_DHQIXKVf6Pr4H8Yqz8uhApk_mnV6Zje6Pr4H8Yqz8A8nCxz6SBghQdS51
|
||||||
|
```
|
||||||
|
|
||||||
### {% linkable_title Use GitHub to get the latest release of Home Assistant %}
|
### {% linkable_title Use GitHub to get the latest release of Home Assistant %}
|
||||||
|
|
||||||
This sample is very similar to the [`updater`](/components/updater/) component but the information is received from GitHub.
|
This sample is very similar to the [`updater`](/components/updater/) component but the information is received from GitHub.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user