Login attempt or request with invalid authentication from 192.168.123.2

I installed the last version HA 0.83.3. It’s failed every time I login from my computer and shows: “Unable to connect to Home Assistant.”. The log file shows:

2018-12-09 01:39:21 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.1763354704] Disconnected: Did not receive auth message within 10 seconds
2018-12-09 01:50:12 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.1763422768] Disconnected: Did not receive auth message within 10 seconds
2018-12-09 01:58:36 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 192.168.123.2
2018-12-09 02:03:00 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 192.168.123.49

and the service show:

01:39:01 mossbian hass[450]: 2018-12-09 01:39:01 INFO (MainThread) [homeassistant.components.http.view] Serving /auth/token to 192.168.1.110 (auth: False)
01:39:01 mossbian hass[450]: 2018-12-09 01:39:01 INFO (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 192.168.1.110 (auth: False)
01:39:21 mossbian hass[450]: 2018-12-09 01:39:21 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.1763354704] Disconnected: Did not receive auth
01:40:24 mossbian hass[450]: 2018-12-09 01:40:24 INFO (MainThread) [homeassistant.components.http.view] Serving /auth/providers to 192.168.123.2 (auth: False)
01:40:24 mossbian hass[450]: 2018-12-09 01:40:24 INFO (MainThread) [homeassistant.components.http.view] Serving /auth/login_flow to 192.168.123.2 (auth: False)
01:49:51 mossbian hass[450]: 2018-12-09 01:49:51 INFO (MainThread) [homeassistant.components.http.view] Serving /auth/login_flow/1bd7eab2673742f4a4f1168783a5039e to 192.168
01:49:52 mossbian hass[450]: 2018-12-09 01:49:52 INFO (MainThread) [homeassistant.components.http.view] Serving / to 192.168.123.2 (auth: False)
01:49:52 mossbian hass[450]: 2018-12-09 01:49:52 INFO (MainThread) [homeassistant.components.http.view] Serving /auth/token to 192.168.123.2 (auth: False)
01:49:52 mossbian hass[450]: 2018-12-09 01:49:52 INFO (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 192.168.123.2 (auth: False)
01:50:12 mossbian hass[450]: 2018-12-09 01:50:12 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.1763422768] Disconnected: Did not receive auth

The same warning also appear when login from my other devices but all can login successed except my computer.
This problem appeared when I installed without change any file or config and I didn’t using DDNS. I tried add trust network and legacy API but doesn’t work.

I checked the port listening. After Switching Protocols the talking suddenly reset as

35	11.084316	192.168.123.128	192.168.123.2	TCP	58	HTTP/1.1 101 Switching Protocols  [TCP segment of a reassembled PDU]
36	11.141174	192.168.123.2	192.168.123.128	TCP	54	10107 → 8123 [ACK] Seq=532 Ack=370 Win=65280 Len=0
37	12.401250	192.168.123.2	192.168.123.255	UDP	82	49701 → 1947 Len=40
38	21.093645	192.168.123.128	192.168.123.2	TCP	54	8123 → 10107 [FIN, ACK] Seq=370 Ack=532 Win=30336 Len=0
39	21.102589	192.168.123.2	192.168.123.128	TCP	54	10107 → 8123 [RST, ACK] Seq=532 Ack=371 Win=0 Len=0

Still don’t know the reason and how to solve this.

Your subnets are weird. Why do you have 1.x and 123.x?

I tried different routers, both not working…

That really doesn’t even make sense.

Clear cache and cookies on your computer for your home assistant and try again.

Changing the router because you can’t login to a local service is like changing the front door to your house because you can’t walk into the bathroom from the hallway

2 Likes

Just want to make sure it’s not cause by the router config, firewall or something else. Because it looks like the HA can’t receive correct auth token…

I have tried clear cache and cookies many time, not working at all.

When you’re connected to the router on your internal Network it doesn’t go through a firewall on the router. It’s all on the same switch. Nothing is routed.

What extensions are running in your browser that could be blocking it?

Thanks for explain that.

I block all extensions on Chrome but still can’t login. I also tried Edge, not working.
When I trie IE its directly show "Unable to connect to Home Assistant. " without load the login page first.

I checked the auth file from \homeassistant.storage. It seems each time I try to login HA creates a new token under “refresh_tokens”. Is that normal?

Sounds like it’s actually logging you in. I would delete all auth and set up the user again.

Tried that, but the same error still appear.

If it’s actually logged me in, I don’t know why there’s still a auth timeout warning. Looks like the HA is waiting for the auth message from my computer. The auth message actually be sent, and HA received the message, show as in the auth file but still think it’s not until time out

That sound weird, but I totally have no ideal what happen and how to solve this…

Update: just update HA to 0.84.1. Seems nothing change to this issue.
Try anything I can but still can’t login…

Have you try the trusted_networks from http config. Also remove the ip_ban.yaml

I can’t help but want to look closely at that subnet of 123 unless it was set intentionally. Routers out of the box are almost always defaulted to .0, .1 or .100… never seen .123 used except in huge corporate LANs.

Did you ever figure this out? I’m getting the same warning, but I don’t have any issues logging into HA from any of my devices…

Im also getting this, I think its from my mobile phone because mostly its pointing to my firewalls internal ip. I can login though so I’m not sure why these messages are apperaing, I want them gone

could it be the home assistant android app that is causing this? I signed out and now I cant sign in with the android app :frowning:

I found that clicking on a esphome esp32 camera entity that is in a state of unavailable causes “Login attempt or request with invalid authentication from” in log file, not sure where to report that, I dont have any other unavailable entities atm, so I dont know if its a esphome issue or a core hass issue.

3 Likes

I’m facing this too, and you are right it’s only when there is an esphome esp32 camera. Ever managed to fix it?

Cheers!

hello community
tried running an ESP32-cam with tasmota FW and it was ok, but the tasmota FW doesn’t have enough options to configure the cams quality
so I went for esp32-cam-webserver and get a stream quality with many options much better than with tasmota

I included the 2 cams like so in my configuration.yaml … minimal so to say

# Cameras
camera:
  - platform: mjpeg
    name: ESP_Cam_1
    mjpeg_url: "http://172.31.5.158:81/"
    still_image_url: "http://172.31.5.158/capture"

  - platform: mjpeg
    name: ESP_Cam_2
    mjpeg_url: "http://172.31.5.159:81/" 
    still_image_url: "http://172.31.5.159/capture"

and I use the lovelace-picture-glance

so far so good, stream is fine, but I always get these log warnings
2021-12-19 13:41:36 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from p200300e62f1c27009d1fb8809d612dac.dip0.t-ipconnect.de (2003:e6:2f1c:2700:9d1f:b880:9d61:2dac). (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15)

this happens reproduceably like so

/dashboard/tab1 - picture glance on AUTO displaying the still image refreshed every 10 secs - click naviagte /dashboard/tab2
/dashboard/tab2 - picture glance on LIVE displaying the stream - click naviagte /dashboard/tab1

(1) I open browser homeassistant and load /dashboard/tab1
(2) naviagte to the stream by clicking o the pic glance still image (/dashboard/tab2), stream runs immediately
(3) back to /dashboard/tab1 and again forth to the stream /dashboard/tab2 like in (2)
(4) /dashboard/tab2 opens without the stream
(5) reload the browserpage on /dashboard/tab2 and the stream is back immediately but a warning is logged

any solution to that? where am I doing wrong?