How to use RESTFUL in trusted_network without authentication(token)?

I have a Synology Surveillance Station(SS) in my home, and configured the Synology integration in HA. The cameras and sensors works well.

One feature lacking in this integration is motion_detection. The workaround is to let SS use webhook to send a motion_detection event to HA, using the RESTFUL API. However, RESTFUL API requires a token in the header (Authorization: Bearer) of the request, which isn’t customizable in Synology SS webhook. (in only let you select GET/POST and the request body)

I found a post from 2018 and the solution was to add trusted_network. This didn’t work for me though. I still received a 401: Unauthorized even if in the same network with curl call.

The configuration of trusted network is:

homeassistant:
  name: My Home
  ...
  auth_providers:
    - type: homeassistant
    - type: trusted_networks
      trusted_networks:
        - 10.0.0.0/24 # my home network

Curl resuest:

curl -X POST -H "Authorization: Bearer " \
  -H "Content-Type: application/json" https://<my_lan_domain>:8123/api/events/fire

Does HA support other auth-less restful request? Thanks.


Btw, there’s nothing wrong with the trusted network as I can login without password in the browser.

Further on in the post you referenced which I’ve been active in was full instructions on how to use a webhook rather the the REST API. That can be found here. That’s what I’m using and it works flawlessly.

Have you solved the problem? I have the same issue and the same setup with the Surveillance Station.

No I ended up create a Python server that forwards the request to HA. It’s been working well in the past year that I even forgot its existence.