Page 1 of 1

web authentication persistence

Posted: Fri Sep 18, 2015 2:11 am
by segordon
Is there any way to make an authenticated client persist indefinitely, or skip authentication all together for a range of IPs?

Have a small client acting as a head with the montage view constantly loaded; as it is right now I must re-auth every so often. This client is within my local LAN, so an IP exemption would be keen. I cannot drop authentication all together, unfortunately.

I wish http://user:pass<host>/zm worked, but it does not.

Thanks

Re: web authentication persistence

Posted: Fri Sep 18, 2015 8:32 pm
by asker
Hello, not absolutely sure what you are after is the answer I am about to give, but is your problem that you want to keep your 'Montage View' on without having to manually re-authenticate?

There are two options:

1) You add a

Code: Select all

&user=xxx&pass=yyyy
to the http url for streaming. For example, if you ever 'view source' when you are watching a monitor feed you'd see something like

Code: Select all

/cgi-bin/nph-zms?mode=jpeg&monitor=1&scale=50&maxfps=5&buffer=1000&auth=e28780da75b57f3012e0f793ef70f033&connkey=557530&rand=1442607729"
You can forget the auth part (it's a little more complex to generate) and instead do

Code: Select all

/cgi-bin/nph-zms?mode=jpeg&monitor=1&scale=50&maxfps=5&buffer=1000&user=xxx&passwd=yyyy&rand=1442607729"
(Where rand is some random number)

Is this what you want?

Or are you considering a situation where the PHP interface is logging you out after a while and montage streaming pauses? The only solution for that is to do a HTTP POST login into zone minder once in a while to /index.php with the user and password as POST data
(see https://github.com/pliablepixels/zmNinj ... pp.js#L343 for an example of how I'm doing it in zmNinja or if you want to do it with curl use the "data" option to pass url encoded login parameters

If you do it with CuRL, I believe it should be

Code: Select all

curl -X POST  -d "username=xxxx&password=xxxx&action=login&view=console"  http://myserver.com/zm/index.php
segordon wrote:Is there any way to make an authenticated client persist indefinitely, or skip authentication all together for a range of IPs?

Have a small client acting as a head with the montage view constantly loaded; as it is right now I must re-auth every so often. This client is within my local LAN, so an IP exemption would be keen. I cannot drop authentication all together, unfortunately.

I wish http://user:pass<host>/zm worked, but it does not.

Thanks

Re: web authentication persistence

Posted: Fri Sep 18, 2015 11:21 pm
by bbunge
You can also set up a web page to view monitors. Here is my code:
------------------------------------------
<html><meta http-equiv="refresh" content="300"><body><h1>Web Site Name</h1>
<p>Camera Group</p>

<img src="http://IP-Address/cgi-bin/nph-zms?mode= ... &pass=user">

<img src="http://IP-Address/cgi-bin/nph-zms?mode= ... &pass=user">

</body></html>
------------------------------------------

I have an unprivileged user set up that can view monitors only. AUTH_RELAY set to none.

monitor= is the number of the monitor you have set up

Page refreshes every 300 seconds