Auth_providers changes broke HA via check_configuration (warning)

I want to put this here because I suspect this shouldn’t have happened, but I was working with the auth_providers section of the configuration, specifically I was trying to ADD trusted networks and trusted users.

I was checking configuration.yaml to see that everything was fine and it broke twice without failing configuration check:

  1. First time it failed when I added a trusted_user via their name and not user_id. The configuration check passed, but when I restarted HA, it wouldn’t fully load past a certain time. I think this should have been caught by the check. Luckily I was still able to access the file editor add-on and fix that issue. (Summary: check configuration didn’t find a problem, but reboot did)
  2. The second time broke totally, as I couldn’t access the GUI. This happened when I added the line allow_bypass_login: true. The GUI broke when I tried to check configuration, which I thought would be safe. I didn’t reload nor restart.

I’m not keen on trying to break it again to confirm these issues, but if anyone is interested, they may want to duplicate this problem so it doesn’t happen to someone else.

OK since I tried to do it again, this will help:

Log section:

e[31m2025-03-20 10:12:20.747 ERROR (MainThread) [homeassistant.config] Invalid config for 'homeassistant' at configuration.yaml, line 22: expected a dictionary for dictionary value 'trusted_users', got Nonee[0m
e[33m2025-03-20 10:12:20.747 WARNING (MainThread) [homeassistant.bootstrap] Unable to set up core integrations. Activating recovery modee[0m
e[33m2025-03-20 10:12:21.152 WARNING (MainThread) [homeassistant.components.hassio.handler] e[33m2025-03-20 10:12:21.152 WARNING (MainThread) [homeassistant.components.hassio.handler] Found incompatible HTTP option 'server_host'. Watchdog feature disablede[0me[0m
e[31m2025-03-20 10:12:27.318 ERROR (MainThread) [frontend.js.modern.202503060] e[31m2025-03-20 10:12:27.318 ERROR (MainThread) [frontend.js.modern.202503060] Uncaught error from Chrome 134.0.0.0 on Windows 10

Configuration:

homeassistant:
  auth_providers:
    - type: trusted_networks
      trusted_networks:
        - 10.7.2.0/24
      allow_bypass_login: true
      trusted_users:
        - 10.7.2.0/24: ac46d1ec0f474ee5acc591028fefd6b0
  auth_mfa_modules:
    - type: totp

Resolved issue with this configuration:

homeassistant:
  auth_providers:
    - type: trusted_networks
      trusted_networks:
        - 10.7.2.0/24
      allow_bypass_login: true
      trusted_users:
        10.7.2.0/24: 
          - ac46d1ec0f474ee5acc591028fefd6b0
  auth_mfa_modules:
    - type: totp

Found another issue with my most recent configuration:

No auth providers returned. Unable to finish login. http://homeassistant01.dns.for.privacy:8123/lovelace?auth_callback=1

This only happened after some time. I guess my configuration above overwrote some defaults that I need to re-add in?

Login broke with the above configuration, since ONLY trusted networks was configured to work.

So I fixed one problem and I’m back to square 1. The login screen shows up again with 2 options: ha or trusted networks auths… I can’t not have type: homeassistant, or it breaks normal login, but now how are we supposed to automatically log in using trusted networks?

homeassistant:
  auth_providers:
    - type: homeassistant
    - type: trusted_networks
      trusted_networks:
        - 10.7.2.0/24
      allow_bypass_login: true
      trusted_users:
        10.7.2.0/24: 
          - ac46d1ec0f474ee5acc591028fefd6b0
  auth_mfa_modules:
    - type: totp

How do I get it to use Trusted Networks from this network?