-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Login attempt or request with invalid authentication #98564
Comments
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) http documentation |
I have a similar issue here. I can log to Home Assistant from any of my Mac computers except one. HA Core version: 2023.8.1 running in a Docker container on a Synology NAS. This is the error I am getting and the "ip_bans.yaml"' file is empty.
|
Hi, Logger: homeassistant.components.http.banhomeassistant.components.http.ban Login attempt or request with invalid authentication from xxxxxxxxxxxx Best regards |
Same problem here, also being triggered by devices on Android 13 - not seeing it occur from any other devices so far. Logger: homeassistant.components.http.ban
|
I got same error and resolve with the following configurations.
I hope it will help to you. |
I have the same issue. Here is the config and the error:
|
What is the 10.19.8.1? Is it your gateway or proxy IP address? If yes I thing it could be added to the trusted_proxies. |
@ademalidurmus it is my IP address, the one that I am trying to access HA from. |
@ivanovd can you try to add your IP address to the trusted_proxies? After configuration update pls restart HA. |
I think it could only help for the moment, until the device get a new puplic-IP from provider/ap. Or i'm wrong? |
Yes, you are right, but this is an internal IP address, and if it can be configured manually instead of using DHCP, it will resolve. Let's wait for @ivanovd's response to understand if it will resolve the problem temporarily or permanently. |
@Tobi9111 @ademalidurmus , it is an internal IP (10.19.8.1). I have added it to the trusted proxies list:
However, I am still getting the same error:
I have also installed and set up nginx proxy manager and added the host there with the following parameters: Still no go ... |
|
@ademalidurmus yes, however, since it is an internal test instance, it will not be accessible from outside of the local network, therefore, I didn't force https and won't be forcing it. Here are all the settings that I have set and tried so far:
I am still getting the same error:
|
First of all, I'm trying to understand. If you are testing with your local environment and your mobile phone is already connected to your local network, why you are trying to connect over nginxproxy? (maybe your subnet is different, you want to isolate your network from the HA, it's possible, anyway) Could you please change this configuration to like same as below? After that, you should configure your mobile app with your HA address like this http://10.19.9.116:8123 for the local connections. If you are already connected to your home wifi you can try to use http://10.19.9.116:8123 instead of FQDN. |
I have similar issue with small screen panels logging into HA over wallpanel app. When I manually login (with login saved ticked) it works. But each time after rebooting the panels system (android) I need to login to HA again. The webview component and wallpanel app are updated.
|
@ademalidurmus I am trying to access the instance via URL in the internal network, and there is a record added to the local DNS server that redirects wc.dreamix.eu to 10.19.9.116, however that still doesn't work. |
@denisivanovdreamix as I understand from your previous comments; the 10.19.9.116 is your HA host IP address. If you added a record to your local DNS server for redirecting wc.dreamix.eu to 10.19.9.116 it means when you access the wc.dreamix.eu will try to access the HA IP address. Bur the HA serving web UI from the 8123 port. So If you want to access with the domain name you should add a record for wc.dreamix.eu to your local proxy IP (your proxy will handle your request and will open your HA), or you can access wc.dreamix.eu:8123 from your local network. BTW, I can access your HA. |
Hi, |
Same issue here, but not using a reverse proxy. I unchecked "Can only log in from the local network" in HA Settings-People, logged out from HA local server and HA cloud, logged in again and re-entered the connection info in Settings - Companion App - Server (HA cloud URL, Wifi SSID and HA internal URL). Perhaps the "Can only log in from the local network" setting in HA Settings-People prevented access after switching from WLAN to mobile network and would then also cause the access token related warnings in the HA log. Not sure if this assumption is correct, but it appears to work for the time being. |
I'm also seeing this error. Not sure exactly when it started or why. My phone (where the error is coming from) only has the nabu casa URL configured in it.
|
I just started having this issues when I signed up for nabu casa and started using the nabu casa link to access from android devices... very odd. It seems to only be 1 of my android device's doing it, I have removed / reinstalled and all and no fix, goes away mostly when that one device is offline (it does still occasionally happen on the other devices but not as consistently). I have to keep removing 127.0.0.1 from my ip ban list because it get's blocked.. with that device on it happens multiple times a day, with it off about once a week. Which then prevents access via nabu casa. |
I seem to be having the same issue.
I've been having this issue from firefox on MacOS. I changed to Safari and it was letting me log on. But just now I was kicked out of my Safari session as soon as it logged me in successfully. So I tried Chrome and it let me in. I only access HA from inside my local network. I use pfSense as my firewall and have full domain certificates for all my services including HA. There are no issues with any certificates and all of my other services work fine including nextcloud, unifi controller etc. I have HA running in Proxmox, which also has a valid certificate. I do use uMatrix on firefox but not on Safari so that is not the issue. I do use pfBlocker on pfSense however looking through the logs there is nothing related to HA. I have not had any issues with the mobile app, so far. I am using iOS. I tried deleting the access tokens in case that was causing the issue but still no joy. So this issue is not limited to some mobile implementation. This issue seems to be due to the |
I am also receiving this with the cao-tag-manager/wirelesstag integration. Log warning below: Logger: homeassistant.components.http.ban Login attempt or request with invalid authentication from cao-tag-manager (192.168.8.36). Requested URL: '/api/events/wirelesstag_update_tags'. (None) |
I also have this issue every day. Any idea what will cause it? Passwords are okay, i can log in with both phones, i have reinstalled apps. Logger: homeassistant.components.http.ban Login attempt or request with invalid authentication from 192.168.100.100 (192.168.100.100). Requested URL: '/api/websocket'. (Mozilla/5.0 (Linux; Android 14; CPH2415 Build/UKQ1.230924.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/120.0.6099.230 Mobile Safari/537.36 Home Assistant/2023.12.4-11898 (Android 14; CPH2415)) Login attempt or request with invalid authentication from 192.168.100.101 (192.168.100.101). Requested URL: '/api/websocket'. (Mozilla/5.0 (Linux; Android 13; KB2003 Build/RKQ1.211119.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/120.0.6099.231 Mobile Safari/537.36 Home Assistant/2023.12.4-11898 (Android 13; KB2003)) |
I just realised - In my case, it was the host device itself (unless I've misunderstood the error). What could cause the localhost itself to trigger this error? In the details it mentions another Android device too but that's why I'm confused about it. I can access it just fine though, from all my devices.
|
This just start happening to me recently, with the companion apps both on Android and IOs. I removed the app from my Android phone and deleted its entry in the Mobile App integration and it connected properly. Now, with no other changes, it is failing again.
I do not have any banning set up. |
Hello. can i modify some to works? |
Same for me. Haven't figured it out yet. |
I am not using any proxy, and I do not have any kind of banning set up. The problem is happening me only with the android companion app when connected to my own WIFI. |
Same setup as i have, with Android companion app. |
@DAVIZINH0 I found this article which talks specifically about it and includes some nginx config info but I don't know how to implement it: https://smarthomeaddict.co.uk/2022/10/home-assistant-remote-access-using-nginx/
|
OKAY here it is! This fixes the login and the add-ons. This is the entirety of the advanced tab in the proxy. I also have the trusted proxies set and the url set in HA.
I have no idea what it does but it works for me. Thanks vague@#homeassistant(irc). |
Same no proxy, I do use nabu casa, and it did only start when I started using that, so if you guys are running nabu casa as well maybe it is related to a proxy issue in the core, although we are not using proxy specifically, nabu casa is likely running proxy to work properly in the back end. |
Yeah, same here, using the nabu casa subscription. It seems to have reduced of late, but it still happens occasionally. |
I seem to be having similar problems with just one iPhone all other work ok. I get this error many times "Login attempt or request with invalid authentication from localhost (127.0.0.1). Requested URL: '/auth/token'. (Home Assistant/2024.4 (io.robbie.HomeAssistant; build:2024.612; iOS 17.3.1) Alamofire/5.8.0)" I then have to re add server to iOS app and log in again. Any suggestions I have "ip_ban_enabled: false", I don't have "Can only log in from the local network" set and I have checked everything to do with network. It seems to happen when the iPhone moves away from the local wi-fi and then returns to it. Thanks |
same issue here
but only for android devices, I installed wireguard vpn on my pi hole |
Same issue for me, I get the following error: using Home Assistant Cloud subscription and Home Assistant (2024.5.4) on a Docker on Synology NAS. configuration.yaml:
Edit: I use MFA using Telegram |
Are these the same issue |
Yesterday my cell phone started with this problem, it doesn't access private pages, VPNs or anything. I use an updated iPhone 13 iOS and updated HA. My wife's cell phone also accesses an iPhone normally! Only my cell phone has this error. I use nabucasa.
|
Same for me with iPhone15. I run Hassio in a MiniPC (exclusively for it). I can access from my wifi at anytime but I am sometimes banned from NabuCasa App (127.0.0.1):
I have installed an VPN (Tailscale) on a Raspberry pi4 to access from outside and delete the ip_bans.yaml file when 127.0.0.1 is banned. I pay the NabuCasa subscription to support the project but it has no sense to have my own VPN and continue paying NabuCasa. |
My problem was solved with the iOS updates (my phone was enabled for beta versions and was not updating the new iOS versions). Homeassistant also updated. I am also a nabucasa subscriber and my HA is installed directly on a Dell optiplex i5 12th, 8gb ram, 250gb ssd computer. |
I'm seeing the exact same problem. Only happening on one device, a Pixel 9. Have been successfully logging in without issue for months then suddenly start getting auth errors and IP bans without changing a single setting. |
Im seeing the same problem with an iphone 15 pro max with a pi running a dedicated HAOS instance. Trying to do a simple proxy through kubernets nginx controller and it just keeps spewing the /auth/token above. I've tried adding extra websocket settings in the proxy with the same error message despite logging in properly. Seems to ONLY be an issue if its going through the proxy. If I use the IP+port in a browser instead of the app, it logs in just fine. Same on a desktop. |
I dont know if this helps someone but i had the same issue and i found that i needed to enable websocket support in Nginx for the HomeAssistant proxy host i set up. |
I have the same problem connecting via IPv6 without any VPN. Sometimes I need to de-/activate Wifi on my phone and after that I'm able the reconnect to HA without an issue again. "Login attempt or request with invalid authentication from Android.fritz.box (2a02:8070:8a83:xxxx:94c5:cb78:xxx:xxxx). See the log for details." |
Sharing my experience as well. I am running HA on a Proxmox server. Used to have a different instance with Nabu Casa that had the domain home.mydomain.com. Now that I switched HA instances, I thought I'd use the same domain, and I get this log: Logger: homeassistant.components.http.ban Login attempt or request with invalid authentication from localhost (127.0.0.1). Requested URL: '/api/websocket'. (Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/6.7.1 Chrome/118.0.5993.220 Safari/537.36) When I use a different URL, like house.mydomain.com, it seems to go way though. I have an Android phone fwiw, but I think the issue might be more on the HA side of things. EDIT: I should also mention that when I remove my custom domain home.mydomain the log goes away. I still have remote access via Nabu Casa, but not with my domain. |
There is an ongoing discussion about that issue here: #114575 |
Its not the same thing. Im not working with cloud/vpn/whatever. |
Well, it is if you follow the discussion. It does not depend on cloud, VPN, tunnel or similar. The common denominator is that the error occurs with mobile/remote connections. It does not depend on the way in which they are set up. |
Ah got it, thanks! |
The problem
My router's IP (192.168.1.253 here) is sometimes banned. Using the official Android app on my smartphone.
I think it happens when I arrive home and my phone connects to my wifi network, and the server URL in the app is different in the app config if I'm home.
My ip_bans.yaml also gets filled with many duplicates, as I can see on anoter bug report here.
What version of Home Assistant Core has the issue?
core-2023.8.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
http
Link to integration documentation on our website
https://www.home-assistant.io/integrations/http
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: