zms[5287]: ERR [Unable to authenticate user]

Support and queries relating to all previous versions of ZoneMinder
rmo
Posts: 22
Joined: Fri Jan 21, 2005 6:57 pm
Location: Germany

zms[5287]: ERR [Unable to authenticate user]

Post by rmo »

Building zm-1.20.0 on an SuSE 9.2 without probs, but i am not able to see
streaming video.

/var/log/messages shows

kernel: pwc Using alternate setting 1.
kernel: pwc set_video_mode(320x240 @ 10, palette 15).
kernel: pwc decode_size = 3.
kernel: pwc Using alternate setting 3.
zmc_d0[5258]: INF [Starting Capture]
zms[5287]: ERR [Unable to authenticate user]
zmc_d0[5258]: INF [ToUCam: 1000 - Capturing at 9.90 fps]

any suggestions ?

rmo
Last edited by rmo on Sat Jan 22, 2005 8:07 am, edited 1 time in total.
unclerichy
Posts: 74
Joined: Wed Feb 25, 2004 5:06 pm

Post by unclerichy »

Now I've got beyond the errors as noted in my previous post I too get the 'user failed to authenticate' error in /var/log/messages. I also can't log on if I turn on user authentication.

For now I've reverted back to 1.19.5 which in itself appears to have caused a few problems...
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Thats's a little odd. Does it make any difference if you log out and then back in again?

Phil
MaxAlex

Beside me exactly such problems

Post by MaxAlex »

Beside me exactly such problems
MaxAlex

Beside me exactly such problems

Post by MaxAlex »

Beside me exactly such problems
Guest

Post by Guest »

I am also having the same problems posted above.

1. Can't view stream, and errror :
zms[5287]: ERR [Unable to authenticate user]

2. Can't log in if authentication is turned on.

Without authentication I configured a monitor and it is capturing events but I cannot view them either.

This is with a fresh install, dropped the old database.

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

Post by zoneminder »

If anyone wants to have a play to help debug this then edit zm_user.cpp and change

Code: Select all

auth_md5[0] = '\0';
to

Code: Select all

auth_md5[0] = '\0';
Info(( "%s -> %s", auth_key, auth_md5 ));
at around line 205.

This should output some extra debug including the key string and the md5 string. The source of your stream window _should_ contain the same md5 string. The key string should be a concatenation of a secret (may be empty), username, password hash, remote IP, hour, day of month, month and year. If anything doesn't look right then let me know. You may want to change sensitive details before you post.

Phil
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin »

Hi Phil,
I made the change to zm_user.cpp and rebuilt and installed.
I am not seeing anything that looks like an md5sum in the source of the stream window or the stream frame.

I got the "Unable to authenticate user" error once only on the first attempt to view a stream, and not since. However still unable to view streams.

Should I also see the md5sum string in syslog messages now? I have not seen any there either.

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

Post by zoneminder »

There are a couple of new authentication options. Check in Options->System and see if ZM_AUTH_METHOD is set to 'hashed'.

Phil
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin »

I have tried both set to hashed and plain, with and without an entry in the secret field. Seems to make no difference.

I found I had the path to nph-zms wrong so now I at least have the "Unable to authenticate user" error back. :)

But still nothing that looks like an md5sum in the page source or the log files. Maybe I am looking in the wrong place.

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

Post by zoneminder »

Can you tell me what your img source line looks like?

Here's one of mine

Code: Select all

<img src="/cgi-bin/nph-zms?mode=jpeg&monitor=1&scale=100&maxfps=15&auth=7af9b7df667cf5ab453d5c967a9ac25e" border="0" width="352" height="288">
The important bit is the 'auth=' part.

Phil
unclerichy
Posts: 74
Joined: Wed Feb 25, 2004 5:06 pm

Post by unclerichy »

Looking at zm_funcs.php, getStreamSrc() doesn't tag on any user ID or 'auth=' entry if ZM_OPT_USE_AUTH is off. Therefore zms.cpp fails auth tests:

I had a bit of a delve...

If I open a monitor using camozola streaming, then the url used is

Code: Select all

<param name="url" value="/cgi-bin/zms?mode=jpeg&monitor=7&scale=100&maxfps=15">
If I use still images, the IMG is

Code: Select all

http://camserver.hunter13.lan/cgi-bin/zms?mode=single&monitor=7&scale=100&1106414099412
I've put a few more debug points in zms.cpp and zms_user.cpp (using Error() as Info() doesn't go to my log files - env. variables missing I guess) and what seems to be the problem is this bit of code in main():

Code: Select all

User *user = 0;
if ( *username && *password )
{
        user = zmLoadUser( username, password );
}
else if ( *auth )
{
        user = zmLoadAuthUser( auth );
}
if ( !user )
{
        Error(( "main:Unable to authenticate user" ));
        return( -1 );
}
username and password contain '\0' (as I'm not authenticating users at the mo) and auth is also '\0' as there's no auth string being passed in.

If I comment out the return(-1) and ValidateAccess() call then I can view the stream.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Ack. Looks like the test for auth being on got lost in a merge!

If you have auth on does it work for you?

Phil
unclerichy
Posts: 74
Joined: Wed Feb 25, 2004 5:06 pm

Post by unclerichy »

zoneminder wrote:Ack. Looks like the test for auth being on got lost in a merge!

If you have auth on does it work for you?

Phil
'fraid not Phil - all attempts to log on just send me back to the logon screen. I'm having a look at it now.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Odder still, as that part hasn't really changed. What version of php do you have?

The other thing I've found recently on FireFox is that sometimes cookies just get 'stuck' and I can actually have two versions of the same cookie and no matter what the 2nd copy of it is set to FireFox always uses the bogus 1st one. Only once both copies of the cookie (which I thought wasn't possible) are deleted does normal behaviour resume. It's possible you are getting this with the session cookie which might be causing the problem.

Phil
Locked