Hass v0.90 Auth Provider-Trusted Networks-HA stops loading

As per advice I am redoing my HA authentication methods and have just added trusted networks as per the documentation in the configuration.yaml. All indents are formatted correctly.

homeassistant:
auth_providers:

  • type: homeassistant
  • type: legacy_api_password
    api_password: !secret http_password
    - type: trusted networks
    trusted_networks:
    • 192.168.0.1
    • 192.168.0.38
    • 192.168.0.122
    • 192.168.0.45
    • fd00::/8
      Since adding the above trusted networks I now see this error in the HA log

2019-04-04 22:45:29 ERROR (MainThread) [homeassistant.auth.providers] Unable to load auth provider trusted networks: No module named ā€˜homeassistant.auth.providers.trusted networksā€™
2019-04-04 22:45:29 ERROR (MainThread) [homeassistant.bootstrap] Home Assistant core failed to initialize. Further initialization aborted

As soon as I comment out the section referring to trusted networks HA starts ok. Have I missed out something while configuring trusted networks in the configuration.yaml

thereā€™s no way for us to know that since you didnā€™t format your code you posted correctly.

It really sounds like an indentation error to me tho.

What do I need to do to get the code to display in plain text format.

homeassistant:
ā€¦ auth_providers:
ā€¦ - type: homeassistant
ā€¦ - type: legacy_api_password
ā€¦ api_password: !secret http_password
ā€¦ - type: trusted networks
ā€¦ trusted_networks:
ā€¦ - 192.168.0.1
ā€¦ - 192.168.0.38
ā€¦ - 192.168.0.122
ā€¦ - 192.168.0.45
ā€¦ - fd00::/8

use three backticks - next to 1 and under ~ on your keyboard. `
three on one line, new line add code, new line three more backticks and itā€™s formatted correctly.

Is there no code copy/paste function on the the forum.

apart from the message at the top that tells you how to copy/paste and format code? Or did you hide that without reading it?

I hid no messages. What did the message say

haconboot.yaml (295 Bytes)

I just attached the section of the configuration.yaml to make it easier

That doesnā€™t make it easier. Forcing people to download your yaml fileā€¦ well Iā€™m not doing it. Just format your code correctly.

According to the semi-formatted code in post 4 it doesnā€™t look correct.

Donā€™t worry.Iā€™ll work something out. Thanks for your time though. Itā€™s nice to be nice though!!!

Thanks.

I thought the error message I saw in the log might have indicated I hadnā€™t configured something else.If itā€™s just down to formatting of the entry in the configuration.yaml I should be able to sort that out. Iā€™ve never has issues with entries in the configuration.yaml before so I suppose thereā€™s always a first.

  auth_providers:
   - type: homeassistant
   - type: legacy_api_password
     api_password: !secret http_password
    - type: trusted networks
      trusted_networks:
        - 192.168.0.1
        - 192.168.0.38
        - 192.168.0.122
        - 192.168.0.45
        - fd00::/8

I managed to sort one problem out. At least I know what to do in future. Three of these at the start of the copy paste did the job ```

Itā€™s like thereā€™s an echoā€¦

but you need three on a line after the code as well otherwise it formats your comments as code as wellā€¦

I think itā€™s your indentingā€¦ when you increase the indent, you add 2 spacesā€¦ so the - should be under the t in auth - move everything one space to the right (except the trusted networks section - that is correct_

the -'s will all line up

EDIT: Yes I know the docs say otherwise and I just submitted a PR to correct them

Well Iā€™ve no chance if thatā€™s the case.

I get the RTFM comments which are not needed as I always read the documentation.

I followed exactly what it stated in the Auth Providers section to the letter of the law but you now state that itā€™s incorrect. Is that the case.

Could you possibly post back exactly how the code should look so others will benefit from it. How did you discover the problem. Was it by trial and error.

No. When you have experience with YAML you see the errors pretty easily which is why itā€™s essential you post using code blocks! As you can see, itā€™s impossible to see a problem if you donā€™t do that.

Sometimes the docs are wrongā€¦ when that happens you edit them and move on and it helps someone else.

I actually told you what to do to fix your codeā€¦ did you not understand what I said?

Anyway, try this:

  auth_providers:
    - type: homeassistant
    - type: legacy_api_password
      api_password: !secret http_password
    - type: trusted networks
      trusted_networks:
        - 192.168.0.1
        - 192.168.0.38
        - 192.168.0.122
        - 192.168.0.45
        - fd00::/8

Thanks for the assistance. Iā€™ll try that and see if it solves the problem.

By any chance are/were you a primary school teacher. Of course the ā€œbackticksā€ you refer to are single back quotation marks. Lesson now understood.

Thanks again.