master - 1.33.9~20190524141652-bionic Auth issues?

Forum for questions and support relating to 1.33.x development only.
Locked
vtdstein95
Posts: 31
Joined: Sun Jan 24, 2016 3:13 pm

master - 1.33.9~20190524141652-bionic Auth issues?

Post by vtdstein95 »

Started having an auth issue with this latest "master" ppa update. Looks like some type of auth issue. zmNinja does not work either. Anyone else experiencing this? I have not changed any settings.
2019-05-28 08:52:27 web_php 6869 ERR Unable to authenticate user from auth hash '' /usr/share/zoneminder/www/includes/auth.php 311
2019-05-28 08:52:26 web_php 6869 ERR Unable to authenticate user from auth hash 'd251b5419a77c03da35a71af4c276a24' /usr/share/zoneminder/www/includes/auth.php 311
2019-05-28 08:52:26 web_php 6869 ERR Insufficient permissions to view log entries /usr/share/zoneminder/www/includes/functions.php 2152
Above is when viewing the log (or similar after any stream) with my full access admin user.


A second but related question, to have direct snapshot link the wiki says to to use the following:

Code: Select all

https://serverip/zm/cgi-bin/nph-zms?mode=single&monitor=6&scale=100&maxfsp=30&buffer=1000&user=zmuser&pass=zmpa55w0rd
My zmuser has view only privileges. With the auth issue I am experiencing this no longer works. Assuming I get auth fixed, what is the best way to provide a link to a snapshot for viewing only? If needed I can open another topic on this question.

2019-05-28 08:51:58 zms_m6 14180 WAR zmuser is using a plain text password, please do not use plain text zm_crypt.cpp 113
2019-05-28 08:51:58 zms_m6 14180 WAR Unable to authenticate user zmuser zm_user.cpp 135
2019-05-28 08:51:58 zms_m6 14180 ERR Unable to authenticate user zms.cpp
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: master - 1.33.9~20190524141652-bionic Auth issues?

Post by asker »

Using your browser:

1. Logout from all browser session
2. Login again
3. Do this for _all_ configured users

After that, try zmNinja etc.


1.33.9 migrates all stored passwords from MySQL hash to Bcrypt. When you update the system, zmupdate.pl script basically takes your existing password hashes (stored using mysql password function) and hashes it again with Bcrypt to make sure we keep them secure.

This however means that existing logged in sessions will not work. You will need to logout and login. When you logout and login, ZM will detect that your login password is hashed doubly and will automatically fix it (because it now has the password you entered in the web console)
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
0xcore
Posts: 3
Joined: Tue May 28, 2019 2:34 pm

Re: master - 1.33.9~20190524141652-bionic Auth issues?

Post by 0xcore »

Previous users and new users created after update to 1.33.9 can't log in. Login screen using browser return "Invalid username or pasword". using ZmNinja return "ZoneMinder Authentication Failed"

Work around It's not working for me. Unable to access from browser or zmninja.
Using your browser:

1. Logout from all browser session
2. Login again
3. Do this for _all_ configured users

After that, try zmNinja etc.
zm/error.log

Code: Select all

2019-05-28 16:29:54 Error: [UnauthorizedException] Incorrect credentials or API disabled
Request URL: /zm/api/host/login.json
Stack Trace:
#0 /usr/share/zoneminder/www/api/lib/Cake/Event/CakeEventManager.php(243): AppController->beforeFilter(Object(CakeEvent))
#1 /usr/share/zoneminder/www/api/lib/Cake/Controller/Controller.php(677): CakeEventManager->dispatch(Object(CakeEvent))
#2 /usr/share/zoneminder/www/api/lib/Cake/Routing/Dispatcher.php(189): Controller->startupProcess()
#3 /usr/share/zoneminder/www/api/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke(Object(HostController), Object(CakeRequest))
#4 /usr/share/zoneminder/www/api/app/webroot/index.php(107): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#5 {main}
zm/web_php.log

Code: Select all

05/28/19 16:50:30.262209 web_php[895].WAR [Login denied for user "view"] at /usr/share/zoneminder/www/includes/auth.php line 185
vtdstein95
Posts: 31
Joined: Sun Jan 24, 2016 3:13 pm

Re: master - 1.33.9~20190524141652-bionic Auth issues?

Post by vtdstein95 »

Thank you for the quick response!

I could not log out of the browser on my desktop but clearing cookies/cache did log me out and browser console now appears to work as it did before (I had to use incognito mode to log in prior to doing this with 1.33.9). However clearing cookies/cache from the browser did not solve the direct link to a snapshot issue. Hoping someone has a suggestion how to make a direct link.

Unfortunately I am not seeing the same for zmNinja. I deleted all profiles, cleared cache, deleted all files and uninstalled/re-installed but still have the same issue. I even went to chrome on my phone and deleted cookies/cache in case zmNinja was leveraging the chrome store.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: master - 1.33.9~20190524141652-bionic Auth issues?

Post by asker »

Yup, I'll be putting out new releases of zmNinja soon.
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
vtdstein95
Posts: 31
Joined: Sun Jan 24, 2016 3:13 pm

Re: master - 1.33.9~20190524141652-bionic Auth issues?

Post by vtdstein95 »

asker, Thanks! I'll be looking/waiting for the zmNinja update.

Anyone have suggestions on how to get a direct link to a camera snapshot working with 1.33.9?

Code: Select all

https://serverip/zm/cgi-bin/nph-zms?mode=single&monitor=9&scale=100&user=zmuser&pass=zmpa55w0rd
Log when trying to use the above snapshot direct link:
2019-05-28 14:18:38 zms_m9 13677 ERR Unable to authenticate user zms.cpp 219
2019-05-28 14:18:37 zms_m9 13677 WAR Unable to authenticate user zmuser zm_user.cpp 135
2019-05-28 14:18:37 zms_m9 13677 WAR zmuser is using a plain text password, please do not use plain text zm_crypt.cpp

UPDATE: The update to master zoneminder=1.33.9~20190528163802-bionic yesterday appears to have solved this direct link to snapshot issue.
Last edited by vtdstein95 on Wed May 29, 2019 12:10 pm, edited 2 times in total.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: master - 1.33.9~20190524141652-bionic Auth issues?

Post by asker »

I've pushed zmninja 1.3.057. Currently testing desktops.
Mobile versions will come soon.

Can you try with both 1.33.9 and previous versions of ZM and let me know?

https://github.com/pliablepixels/zmNinj ... g/v1.3.057

On your second point, take a look at the password for that user in the SQL DB for ZM, Table Users -> is there a "--ZM--" in front? If so, try running sudo zmupdate.pl -f. Snapshot works in 1.33.9 - I just tried it on my instance.
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
0xcore
Posts: 3
Joined: Tue May 28, 2019 2:34 pm

Re: master - 1.33.9~20190524141652-bionic Auth issues?

Post by 0xcore »

1.3.057 works perfect with zm 1.33.9 on MacOS high Sierra.
vtdstein95
Posts: 31
Joined: Sun Jan 24, 2016 3:13 pm

Re: master - 1.33.9~20190524141652-bionic Auth issues?

Post by vtdstein95 »

agree with Oxcore

zmNinja 1.3.057 works perfect with zm 1.33.9 on Windows 10. Will be on the lookout for the push of the Android version.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: master - 1.33.9~20190524141652-bionic Auth issues?

Post by asker »

The android version is already in the beta channel (see viewtopic.php?f=33&t=27699 for beta links). Please test and let me know. iOS will be up soon.
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
vtdstein95
Posts: 31
Joined: Sun Jan 24, 2016 3:13 pm

Re: master - 1.33.9~20190524141652-bionic Auth issues?

Post by vtdstein95 »

Confirmed the 1.3.057 version of zmNija on Android is working with the 1.33.9 version of ZM.

asker,
Thank you for you quick work/fixes.
0xcore
Posts: 3
Joined: Tue May 28, 2019 2:34 pm

Re: master - 1.33.9~20190524141652-bionic Auth issues?

Post by 0xcore »

Confirmed ZmNinja test flight version 1.3.0.59 works now on iPhone 12.2 with ZM 1.3.39
Locked