finish06 / pyunifi

https://unifi-sdn.ubnt.com/
MIT License
223 stars 99 forks source link

Add token authentication #63

Closed swingerman closed 2 years ago

swingerman commented 3 years ago

related to https://github.com/custom-components/sensor.unifigateway/issues/37

It seems that Unifi controller requires an authorization header for each request.

I implemented this with a logic that checks if the login response contains a cookie with the token and if sent it uses for each read and write requests.