Trusted_networks - not working - no idea why?

hi,

I tried to get trusted_networks to work, in order to avoid the 2-auth-login, which I set up:

So “multi-factor-auth” is ON.

my config (btw: I use a “frenck”-like config, with a lot of yaml files, which works perfectly so far); am using hassio on a proxmox VE on a NUC.

homeassistant:
  auth_providers:
    - type: homeassistant
    - type: trusted_networks
      trusted_networks:
        - !secret trusted_network_1
        - !secret trusted_network_2
        - !secret trusted_network_3

secrets.yaml
# Auth Provider
trusted_network_1: 192.168.y.0/24
trusted_network_2: 127.0.0.1
trusted_network_3: 10.y.x.0/24 

Every time I login from 192.168.y.x (with should be a trusted network), I have to get through the full authentfication :frowning:

I also so no information in the logs whatsoever.

Any ideas, how to solve it?

best!

thx… so the concept is dead?
best

My trusted_networks under auth_providers are still working in 101.3. Could it be a spacing issue with your type declarations?

ah … good to hear.

@GaryK: maybe you could post your configuration for comparison…

# authentication services
  auth_providers:
   - type: homeassistant
   - type: trusted_networks
     trusted_networks:
       - 192.168.x.0/24
       - 127.0.0.1

thanks … but I don’t see any difference, except the !secret. and I tried it without the “secrets” without any luck as well… strange

My spacing is different. I shift two columns for each entry. Yours appears to be three.

“auth_providers” to “- type” - there you have only 1 space: your “-” is below “u” and I have two spaces - mine is under “t”.

but in general there should be two spaces right?

Yes, two spaces is the syntax. Other than that, you might try listing your networks directly instead of using secrets. Works for me.

without !secrets, it doesn’t work either :frowning: I really have no clue whatsoever.

I assume you’ve restarted HA between changes?

Did that twice :slight_smile:

Well, it does work. I don’t know why it’s not working for you.

Clear browser cache or try from different device?

Use different browser to test

Yes, its the spacing.
As GaryK said, you have too many spaces.

@Vennerberg: where exactly do I have too many spaces? please clarity… thanks!

I have 2 spaces each - visual code studio does not complain.

What I can see from your pasted config your “-” is not in the same locations as @GaryK. You say its the same but from the looks of it its not.

@Vennerberg: I see that it is NOT the same, but mine should be correct. I have 2 spaces in the lines “- type”, so my “-” is underneath the “t” (from auth_providers), whereas the one from gary only has one space (underneath "u).

because 2 spaces are the syntax, I suppose mine is correct. this is why I am wondering, mine is NOT working and Garys is working (but it shouldn’t).

I am really out of ideas how to get this working.

One thing is that if you have the homeassistant auth provider first it will use that as a preference so move that to the bottom. I use trusted networks as well. Can’t remember the last time I had to enter details.