mueslo / openwrt_hass_devicetracker

Simple OpenWRT package which forwards device connection changes to a HomeAssistant instance
GNU General Public License v3.0
92 stars 31 forks source link

Update authorization type for new version home-assistant. #4

Closed radroxx closed 5 years ago

radroxx commented 6 years ago

You need change X-HA-Access header to "authorization: Bearer" for Long Token.

mueslo commented 6 years ago

AFAICT the legacy API password method should still work and I won't be changing it yet since the HA authentication system is still in a state of flux

radroxx commented 6 years ago

After the update home-assistant, the utility did not work for me. Maybe I did not fully understand. But you can also add to the config file the ability to choose a method.

partofthething commented 6 years ago

@radroxx did you still have the legacy_api_password authentication type operational in your hass config when this stopped working for you?

radroxx commented 6 years ago

@radroxx did you still have the legacy_api_password authentication type operational in your hass config when this stopped working for you?

I use the official docker container, after updating the utility stopped working. I stopped receiving notifications from the home-assistant. All the settings were the same as for the old version of the home-assistant.

mueslo commented 6 years ago

I'm not on 0.77 yet. However, the documentation states:

To make the transition from API password to authentication system easier, we’ve added a legacy API password auth provider. This enables users to log in with the API password. This authentication provider is enabled by default if a user has an API password configured.

So it sounds like you didn't have an API password set.

partofthething commented 6 years ago

I can confirm this. I'm on 0.78 and set the legacy_api_password:

  auth_providers:
      - type: homeassistant
      - type: legacy_api_password

and it started working again... for now!

mueslo commented 6 years ago

I can confirm this. I'm on 0.78 and set the legacy_api_password:

  auth_providers:
      - type: homeassistant
      - type: legacy_api_password

and it started working again... for now!

Is it really necessary to manually enable legacy_api_password auth? The docs state that all that's necessary is setting the api password in the configuration like so:

http:
  api_password: yourapipassword
rytilahti commented 6 years ago

At the moment api_password will automatically enable the legacy api provider. Long-lived access tokens are merely supported since the newest release (https://github.com/home-assistant/home-assistant/pull/16453), so I think the support for the legacy API will stay there for a while. Only problem with that is the log entries related to suggesting conversion to those.

miawgogo commented 6 years ago

I might work on implementing support for the long lived tokens that where also introduced in auth update

miawgogo commented 6 years ago

I have some code written, just need to package it and test it on my router

Cadair commented 5 years ago

Closed by #5 ?