web authentication persistence

Forum for questions and support relating to the 1.28.x releases only.
Locked
segordon
Posts: 37
Joined: Tue Aug 11, 2015 10:04 am

web authentication persistence

Post 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
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: web authentication persistence

Post 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
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: web authentication persistence

Post 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
Locked