Authentication mode + streaming

Support and queries relating to all previous versions of ZoneMinder
Locked
gregmac
Posts: 17
Joined: Tue Mar 30, 2004 4:31 pm

Authentication mode + streaming

Post by gregmac »

Got ZM setup and working great with auth turned off, so I went to turn it on, and now streaming (and stills) is broken, for both live and recorded events. Just shows up as a broken image, and if I right click and "view image", it says 500 internal server error.

with plain auth set, I get this:

access.log:

Code: Select all

10.10.6.2 - - [27/Jul/2005:21:51:09 -0400] "GET /security/index.php?view=watchevents&max_events=10&mid=2 HTTP/1.1" 200 10337 "http://its/security/index.php?view=watch&mid=2&control=&mode=still&scale=100" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"
10.10.6.2 - - [27/Jul/2005:21:51:09 -0400] "GET /cgi-bin/zms?mode=single&monitor=2&scale=100&user=admin&pass=&rand=1122515468HTTP/1.1" 500 644 "http://its/security/index.php?view=watchfeed&mode=still&mid=2&scale=100&control=" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"
10.10.6.2 - - [27/Jul/2005:21:51:12 -0400] "GET /cgi-bin/zms?mode=single&monitor=2&scale=100&user=admin&pass=&rand=1122515468HTTP/1.1" 500 644 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"
error.log:

Code: Select all

[Wed Jul 27 21:51:09 2005] [error] [client 10.10.6.2] Premature end of script headers: zms, referer: http://its/security/index.php?view=watchfeed&mode=still&mid=2&scale=100&control=
Extraneous options, 2
zmu <-d device_no> [-v] [function] [-U<username> -P<password>]
zmu <-m monitor_id> [-v] [function] [-U<username> -P<password>]
General options:
  -h, --help                     : This screen
  -v, --verbose                  : Produce more verbose output
Options for use with devices:
  -d, --device <device_no>       : Get the current video device settings for /dev/video<device_no>
  -q, --query                    : Query the current settings for the device
Options for use with monitors:
  -m, --monitor <monitor_id>     : Specify which monitor to address, default 1 if absent
  -q, --query                    : Query the current settings for the monitor
  -s, --state                    : Output the current monitor state, 0 = idle, 1 = alarm, 2 = alert
  -B, --brightness [value]       : Output the current brightness, set to value if given
  -C, --contrast [value]         : Output the current contrast, set to value if given
  -H, --hue [value]              : Output the current hue, set to value if given
  -O, --colour [value]           : Output the current colour, set to value if given
  -i, --image [image_index]      : Write captured image to disk as <monitor_name>.jpg, last image captured
                                   or specified ring buffer index if given.
  -S, --scale <scale_%ge>        : With --image specify any scaling (in %) to be applied to the image
  -t, --timestamp [image_index]  : Output captured image timestamp, last image captured or specified
                                   ring buffer index if given
  -R, --read_index               : Output ring buffer read index
  -W, --write_index              : Output ring buffer write index
  -e, --event                    : Output last event index
  -f, --fps                      : Output last Frames Per Second captured reading
  -z, --zones                    : Write last captured image overlaid with zones to <monitor_name>-Zones.jpg
  -a, --alarm                    : Force alarm in monitor, this will trigger recording until cancelled with -c
  -n, --noalarm                  : Force no alarms in monitor, this will prevent alarms until cancelled with -c
  -c, --cancel                   : Cancel a forced alarm/noalarm in monitor, required after being enabled with -a or -n
  -u, --suspend                  : Suspend detection, useful to prevent bogus alarms when panning etc
  -r, --resume                   : Resume detection after a suspend
  -U, --username <username>      : When running in authenticated mode the username and
  -P, --password <password>      : and password combination of the given user
  -A, --auth <authentication>    : Pass authentication hash string instead of user details
[Wed Jul 27 21:51:12 2005] [error] [client 10.10.6.2] Premature end of script headers: zms
Error, unable to authenticate user


with auth set to encoded:

access.log:

Code: Select all

10.10.6.2 - - [27/Jul/2005:21:53:18 -0400] "GET /cgi-bin/zms?mode=jpeg&monitor=2&scale=100&maxfps=15&auth=6570a71238f25a3dada0ec3613c7dc7d&rand=1122515585 HTTP/1.1" 500 644 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"
10.10.6.2 - - [27/Jul/2005:21:55:19 -0400] "GET /security/index.php?view=watch&mid=2 HTTP/1.1" 200 1007 "http://its/security/index.php" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"
10.10.6.2 - - [27/Jul/2005:21:55:19 -0400] "GET /security/index.php?view=watchmenu&mode=&mid=2&scale=100&control= HTTP/1.1" 200 1521 "http://its/security/index.php?view=watch&mid=2" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"
10.10.6.2 - - [27/Jul/2005:21:55:19 -0400] "GET /security/index.php?view=watchfeed&mode=&mid=2&scale=100&control= HTTP/1.1" 200 569 "http://its/security/index.php?view=watch&mid=2" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"
10.10.6.2 - - [27/Jul/2005:21:55:19 -0400] "GET /security/index.php?view=watchevents&max_events=10&mid=2 HTTP/1.1" 200 10337 "http://its/security/index.php?view=watch&mid=2" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"
10.10.6.2 - - [27/Jul/2005:21:55:19 -0400] "GET /security/index.php?view=watchstatus&mid=2&control= HTTP/1.1" 200 743 "http://its/security/index.php?view=watch&mid=2" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"
10.10.6.2 - - [27/Jul/2005:21:55:19 -0400] "GET /cgi-bin/zms?mode=jpeg&monitor=2&scale=100&maxfps=15&auth=06658caa328ae97cc35ce8838656e8e6&rand=1122515719 HTTP/1.1" 500 644 "http://its/security/index.php?view=watchfeed&mode=&mid=2&scale=100&control=" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4"
error.log:

Code: Select all

Error, unable to authenticate user
Error, unable to authenticate user
[Wed Jul 27 21:53:18 2005] [error] [client 10.10.6.2] Premature end of script headers: zms
Error, unable to authenticate user
[Wed Jul 27 21:55:19 2005] [error] [client 10.10.6.2] Premature end of script headers: zms, referer: http://its/security/index.php?view=watchfeed&mode=&mid=2&scale=100&control=
I enabled auth using the 'options' button in the web interface, and restarted zoneminder in between all changes. If I turn auth off completely, it works again.

Thanks for any suggestions..
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

You might want to follow this thread if you are using PHP4.4
http://www.zoneminder.com/forums/viewtopic.php?t=4705
Regards,
Cordel
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

On another thought, you don't have any strange characters in the username or password by any chance?

Phil
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Actually scratch that. I can see it using auth strings. You could try changing the auth mode (Options->System->ZM_AUTH_METHOD) and see if that makes any difference.

Phil
gregmac
Posts: 17
Joined: Tue Mar 30, 2004 4:31 pm

Post by gregmac »

PHP 4.3.10 (debian package). No weird auth strings. I've tried with both auth methods (hashed and plain, sorry, i called hashed "encoded" in my post) - they give different output, as I showed, but neither works. This is zm-1.21.3.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

This is odd. Zmu seems to think it's being passed additional options but I can't see what they are. It may be we have to add debug to the php to see what is being invoked.

For now though you could try setting ZM_DBG_LEVEL_zmu to 9, and ZM_DBG_PRINT to 1 and then running zmu from the command line. It should emit a bit more debug about the authentication process which might help.

Phil
gregmac
Posts: 17
Joined: Tue Mar 30, 2004 4:31 pm

Solved

Post by gregmac »

Solved:

I was missing libcrypt.a (from debian package libssl-dev). Only noticed while I was trying to add in --with-ffmpeg and noticed the message scroll by as a warning while running configure.

This should probably be made more prominent, as it was very easy to miss and caused some very strange symptoms.
rexxar
Posts: 1
Joined: Thu Jul 26, 2012 7:47 pm

Re: Authentication mode + streaming

Post by rexxar »

Hi, im having the same problem in a ubuntu 12.04 64bits.

i installed libssl-dev but didnt help. If i turn on the autentication i cant see any image.

Any ideas ?
Locked