Update docs.md

This commit is contained in:
Yegor Vialov 2019-08-28 00:23:33 +03:00 committed by GitHub
parent f2acdf2d88
commit e88f499100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

12
docs.md
View File

@ -55,20 +55,22 @@ Minimum supported Android API level is 21. Thats Android 5.0 and higher.
[Back to top](#documentation)
## Authentication
### HA Client 0.6.0 and higher
Starting from version 0.6.0 HA Client will be authenticating through [Home Assistant Authentication API](https://developers.home-assistant.io/docs/en/auth_api.html). You don't need to create and recreate access tokens any more. For now if HA Client is not authenticated yet or there is some issues logging in, it will ask you to login to your Home Assistant web interface with your credential:
There is two ways to login to Home Assistant with HA Client
### Home Assistant OAuth
HA Client will login through [Home Assistant Authentication API](https://developers.home-assistant.io/docs/en/auth_api.html). You don't need to create and recreate access tokens. If HA Client is not authenticated yet or there is some issues logging in, it will ask you to login to your Home Assistant web interface with your credential:
![image](/assets/images/oauth.png)
After successfull login HA Client will get secure code, request long-lived token from Home Assistant automatically and store it is secure storage of your Android device.
After successfull login HA Client will get secure code, request long-lived token from Home Assistant automatically and store it in secure storage of your Android device.
There is also 'Logout' option added. It will disconnect from Home Assistant, clear the UI and remove long-lived token from secure storage:
![image](/assets/images/logout.png)
[Back to top](#documentation)
### Prior HA Client 0.6.0
Starting from Home Assistant 0.78.0 `api_password` is a deprecated way to authenticate third party apps and services. You should use long-lived access tokens instead. To make HA Client use access token to authenticate you need:
### Manual long-lived token
It is possible to generate long-lived token manually and set the app to use it instead of logging in with a simple OAuth way.
To make HA Client use your generated long-lived token you need:
1. Go to your Home Assistant web interface and open your profile settings (just click on your user picture in the top part of left menu)
![image](/assets/images/ha_profile.png)