Is anyone successfully using basic authentication via .htpasswd with nginx? I have SSL and reverse proxy set up and working well, but as soon as I enable basic auth, I run into problems. After entering in my credentials, the HA UI just churns, eventually telling me it is unable to connect. When I disable it, everything works fine.
I found what looks to be a similar issue described here :
That was my post. There is one more solution that was offered that I havenāt tried yet. Going to try this weekend after I upgrade my Hass.
Nginx basic auth works fine on a laptop now both on wifi and external with port forwarding, but on mobile, I still have that issue where post login, it drops me at a hass login page (hass api password is disabled).
Let me know how it goes. Iād feel better about my setup with auth working.
I am having the issue in both Safari on my Mac and on my iPhone. Your comment that it was working on your laptop made me wonder what another browser would do. And guess what, it works fine in Chrome on my Mac. So maybe something Apple/Safari specific?
Iāve just began using home assistant a few days ago, and Iāve just run into this issue. Thereās a ton of posts about this problem, but no solutions. In my case, I just want api access (donāt need webpage access) to my HA server from the internet --but I also wanted it to be as secure as possible. Since I canāt use Basic Authentication, the solution I came up with is just the specify the api path:
If anyone has any ideas on how make to make this even more secure, please let me know. I canāt really specify allowed IPās, as Iām receiving POST requests from IFTTT, and donāt want to spend time updating IP address lists.
Iām also having this problem. It does not happen after clearing the cache, but starts happening after some time (after session timeout, I guess). On nginxās access.log I see many 401 request errors.
auth_basic āRestrictedā and HA login enabled. Commenting auth_basic solves the problem.
I have tried every config I found here on the forum.
Having the same issue as everyone else. No iOS for me though. Chrome on Windows works fine, but Chrome on Android breaks like iOS does. Iāve installed Firefox on Android which seems to work ok.
I navigated to the /api/websocket address which made the basic auth window popup. I authenticated it and then went to the /states URL which worked.
Theoretically we could create an index.html file somewhere with html to redirect it back to /states. It should then auth on our new page, load our page which then flicks you back to the HA /states URL.
Theoretically.
Itās late here now so I might give this a shot tomorrow night.
@mattyman I ended up switch to oauth2 using bitly/oauth2 behind nginx, and that worked fine without any problems. The hard part was setting it up, but it worked great after that.