web authentication persistence

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

web authentication persistence

Post by segordon » Fri Sep 18, 2015 2:11 am

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: 1421
Joined: Sun Mar 01, 2015 12:12 pm

Re: web authentication persistence

Post by asker » Fri Sep 18, 2015 8:32 pm

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
Please don't ask me questions via PM. Feel free to post in the forums or Github

My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

bbunge
Posts: 2709
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: web authentication persistence

Post by bbunge » Fri Sep 18, 2015 11:21 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests