I have attempted to use the legacy api authentication but that is not working for me and we are told it will not be support for very long so I haven’t tried to fix it.
I would like to be able to replace the short lived token with a long lived token or have some other reliable way to access these streams with most NVRs.
i am also interested in this development.
I have to insert in motioneye an esp cam which does not have the possibility of direct connection.
I would like to insert a long-lived token to be able to connect the cam
thank you
Im also interested in this, having no luck, I can create the long lived token but I am on a loss on how to implement it and how to learn how to implement it for this use.
The token query parameter only works for short lived tokens.
To use long lived tokens, the header Authorization: Bearer ABCDEFGH can be used, where ABCDEFGH is the long lived token.
See here for how this works and examples using curl.
As a fix for motioneye / other NVRs which do not allow for custom headers to be added, you can use nginx to add the header when the request originates from a certain IP address / range.
I have not. I tried to make it work with the nginx proxy and the nginx proxy manager add ons for HA without success so far (after spending a few hours…). I have attributed that lack of success to my limited knowledge of nginx and am slowly trying to learn more. For now I was forced to use Arduino ide for my cameras, though I would greatly prefer esphome (mostly because it makes it easy and I am lazy).
I’ll share my config, in case it’s of any use to anyone. I have never used proxy manager, so I’m not sure how it works and where / how to add config files. I’m using Nginx SSL Proxy addon, and I’ve added this to /share/nginx_proxy/motioneye.conf
Where abcdefABCDEF1234 is obviously your real token.
You may want to use SSL and change the server_name, if motioneye is running on a different machine. I’ve set server_name to localhost, so I’m not worried about any security issues from not using SSL/TLS. The way the nginx addon is set up for me, port 80 in the addon’s container is actually bound to port 8080 on the host, hence the Host header. Though the port is mostly irrelevant anyway, you can probably get away with changing that line to just .. $host;