Long Lived Access token authentication fails
See original GitHub issueHi,
I hope I just have a missing configuration here and not a bug but let’s see.
I use the latest docker version as provided by Causticlab 0.4.0. I’ve configured the following environment variables:
HC_BASEPATH=/hass-config/
HC_API=http://homeassistant:8123/api/ <- docker interal routing
HC_HASS_WS_API=wss://homeassistant.url.tld/api/ <- browser url
HC_HASS_API_PASSWORD=token
Problem
- When trying to observe events by websockets the connection is closed instantly.
- When sending commands to HASS, like a restart, it fails.
Ha-configurator logfile:
WARNING:2020-08-22 13:42:33,417:__main__:<urlopen error [Errno 111] Connection refused>
Homeassistant logfile:
[homeassistant.components.http.ban] Login attempt or request with invalid authentication from 10.0.6.36
Question Am I missing a certain configuration or not using the right set here?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Long-lived access token fails sometimes - Configuration
Hi, I have a homemade sensor that uses the Long-lived access token to authenticate towards the api on homeassistant.
Read more >Exchange short-lived access token for long-lived, not working
I am trying to exchange a short-lived user access token for a ling-lived, but getting an an error (in all.js):.
Read more >Debugging & Errors - Facebook Login
Expired or invalid access tokens This response is sent when a person logged out of your app or changed their password. The person...
Read more >Access Token Lifetime - OAuth 2.0 Simplified
The access tokens may last anywhere from the current application session to a couple weeks. When the access token expires, the application will ......
Read more >Antipattern: Set a long expiration time for OAuth tokens
Setting a long expiration time for an access token and/or refresh token in the OAuthv2 policy leads to accumulation of OAuth tokens and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m not really familiar with Docker-setups, so I have to refer you to the documentation for that.
I don’t think the version is the issue here. Even though it’s been a while since I’ve worked on this, I believe from 0.3.7 to 0.4.0 no significant changes related to the access token have been made. It was mainly refactoring to make the package for pip and including some JavaScript code which usually was fetched from cloud resources. The Token-stuff has been stable for a long time. So that shouldn’t be the problem in this case.
The quotes in the file are required because it’s a JSON file. It would be a syntax error to have a string without quotes. For the env-variable you don’t need quotes, and I don’t have quotes in my unit-file.
If the value is not prefilled, the API shouldn’t work as well. If it does, then that’s because you have configured HA to always allow connections from certain locations. The token used to communicate with the API and the prefilled value in the UI are exactly the same. So if one is missing, the other is missing too. So if one is working and the other is not, it must be a policy-thing outside of the scope of the configurator.