michael
(Michael)
April 7, 2020, 9:31pm
24
Just for information, I tried adding:
- my_home_subnet
- 127.0.0.1
- 172.30.33.0/25
to trusted networks. 172.30.33.0/25 is hassio add-ons subnet. And I am still getting authorization errors.
I will just wait untill 0.108 is out and, if ip_ban is not fixed there, will try to remove all camera streams from frontend for a test.
michael
(Michael)
April 14, 2020, 6:03pm
25
So it was something else in my case, not camera streams - I have now no camera streams at frontend and still invalid authentication attempts.
I am interested in last_authenticated sensor, how would you set it up? Thanks!
Use this
Then in configuration.yaml you will need this:
http:
use_x_forwarded_for: true
trusted_proxies:
- 127.0.0.1
- ::1
ip_ban_enabled: true
login_attempts_threshold: 5
# Logger
logger:
default: warn #warn
logs:
custom_components.sensor.authenticated: debug
You will then have a sensor.last_successful_authentication you can display in lovelace like this:
1 Like
Thank you, This is really helpful!
@DavidFW1960
Have you had any luck in getting the notification to work (per the documentation) ?
My code (configuration.yaml)
sensor:
- platform: authenticated
enable_notification: true
provider: ipapi
hmmm…
Here’s my config, would you be kind enough to compare against yours to see if I am missing something?
homeassistant:
auth_providers:
- type: trusted_networks
trusted_networks:
- 192.168.0.0/24
trusted_users:
192.168.0.0/24:
- userID 1- redacted
- userID 2- redacted
- userID 3- redacted
- userID 4- redacted
- userID 5- redacted
- userID 6- redacted
- type: homeassistant
http:
use_x_forwarded_for: true
trusted_proxies:
- 127.0.0.1
- ::1
ip_ban_enabled: true
login_attempts_threshold: 3
logger:
default: warn
logs:
custom_components.sensor.authenticated: debug
sensor:
- platform: authenticated
enable_notification: true
provider: ipapi
Here is auth. My http is shown in above post.
# Auth & 2FA
auth_mfa_modules:
- type: notify
- type: totp
auth_providers:
- type: trusted_networks
trusted_networks:
- 127.0.0.1
- ::1
- !secret my_ipv4_network
- fd00::/8
- !secret zerotier_network
- !secret my_ipv6_network
trusted_users:
127.0.0.1: !secret user_id
"::1": !secret user_id
!secret trusted_ipv4: !secret user_id
"fd00::/8": !secret user_id
!secret trusted_ipv6: !secret user_id
!secret zerotier_network: !secret user_id
allow_bypass_login: true
- type: homeassistant
Configuration of component:
# Sensors
sensor:
# Authentication Sensor
- platform: authenticated
enable_notification: true
provider: 'ipapi'
exclude:
- !secret my_ipv4_network
- fd00::/8
- !secret zerotier_network
- !secret my_ipv6_network
1 Like
DavidFW1960:
platform: authenticated
made a few adjustments… will have to see if that help any.
I like how you are using the secrets file for compartmentalizing the users and network info (had to take that into my setup, so thanks for showing that off).
1 Like
started getting the notifications.
1 Like
Jester
December 7, 2020, 4:10pm
35
I don’t have banning enabled and don’t have ip_bans.yaml in my config folder but HA dosen’t let me log in from a specific IP of my desktop.
Has anyone else experienced similar problem?
Logs;
Logger: homeassistant.components.http.ban
Source: components/http/ban.py:114
Integration: HTTP (documentation , issues )
First occurred: December 4, 2020, 11:17:43 AM (7occurrences)
johnny1
(johhny1)
February 21, 2021, 5:47pm
36
I also keep getting one of my tablets constantly banned for no reason for years now. This is a very annoying issue.
It’s a shame you didn’t accept https://github.com/home-assistant/core/pull/18770 PR that addressed this issue.
1 Like
sender
July 25, 2021, 4:00pm
37
I voted because I have the same issue and I can’t believe this is so hard to fix
That (was working for years) seems to be partly broken now after updating to HA 2022.4: now attributes (like hostname, user, new_ip) are completely missing. Don’t know why. Any ideas how to get back this? Mainly detecting new first time/logins for being able to *do something*
.
Seems ok here
It has been showing that docker container for days now though…
Found something. Fix seems to be “on the way” but didn’t arrive for weeks. And whole project is marked as deprecated according to readme
opened 11:47AM - 19 Apr 22 UTC
closed 12:07PM - 19 Apr 22 UTC
**Version of the custom_component**
21.9.0
**Describe the bug**
Unlike be… fore, ever since the upgrade to 2022.4 version of HomeAssistant, the `sensor.last_successful_authentication` sensor doesn't contain any attribues (other than `icon` and `friendly_name`).
![image](https://user-images.githubusercontent.com/3136012/163993120-bb98fa94-80af-4891-b089-ac306035e611.png)
I do see the **presistant_notification** popping up with the right data.
**log**
```
2022-04-19 14:27:04 WARNING (SyncWorker_12) [homeassistant.loader] We found a custom integration authenticated which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-04-19 14:27:24 INFO (SyncWorker_1) [JELLYFIN.jellyfin_apiclient_python.client] User is authenticated.
2022-04-19 14:27:25 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.authenticated
2022-04-19 14:27:25 INFO (SyncWorker_4) [custom_components.authenticated.sensor]
authenticated
https://github.com/custom-components/authenticated/issues
2022-04-19 14:46:35 INFO (SyncWorker_12) [custom_components.authenticated.sensor] New successful login from known IP (xx.xx.xxx.xx)
```
I remember now. I manually edited the sensor.py file. It’s only 1 line that needs a change.
1 Like
ShadCrow
(Shad Crow)
June 14, 2022, 2:23am
42
I ended up creating a new feature request that as a high level summary to attempt to improve discoverability of those afflicted by this issue. If anyone has a better idea of how to resolve this, please continue to share:
Situation: As reported by others, there appears to be a bug that has not been documented here that causes failed authentication with a specific, but common, workflow.
Have a picture entity (or camera?) on the screen of the device you are using (Xiomi map integration is one such example)
Put the device to sleep (tested on phone app, but it appears kiosk devices act similarly so I would assume this also may impact computers).
Return to the device after some time.
Of note, the above workflow was…
1 Like
Escovan
(Jelle van der Pal)
May 12, 2024, 11:01am
43
Yes. If this is about a cheap Tuya camera, I think your suggestion just solved my question as to why my own IP got locked out.