Did a reinstall and followed my instructions this time!
Prior to turning OPT_AUTH on I ran
http://server/zm/api/host/getVersion.json which returned:
{
"version": "1.28.106",
"apiversion": "1.28.106.1"
}
With a user set and OPT_AUTH turned on and the server rebooted,
http://server/zm/api/host/getVersion.json returned:
{
"success": false,
"data": {
"name": "Not Authenticated",
"message": "Not Authenticated",
"url": "\/zm\/api\/host\/getVersion.json",
"exception": {
"class": "NotFoundException",
"code": 404,
"message": "Not Authenticated",
"trace": [
"#0 [internal function]: AppController->beforeFilter(Object(CakeEvent))",
"#1 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Event\/CakeEventManager.php(244): call_user_func(Array, Object(CakeEvent))",
"#2 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Controller\/Controller.php(674): CakeEventManager->dispatch(Object(CakeEvent))",
"#3 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Routing\/Dispatcher.php(187): Controller->startupProcess()",
"#4 \/usr\/share\/zoneminder\/www\/api\/lib\/Cake\/Routing\/Dispatcher.php(165): Dispatcher->_invoke(Object(HostController), Object(CakeRequest))",
"#5 \/usr\/share\/zoneminder\/www\/api\/app\/webroot\/index.php(108): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))",
"#6 {main}"
]
},
"queryLog": {
"default": {
"log": [
{
"query": "SELECT `Config`.`Id`, `Config`.`Name`, `Config`.`Value`, `Config`.`Type`, `Config`.`DefaultValue`, `Config`.`Hint`, `Config`.`Pattern`, `Config`.`Format`, `Config`.`Prompt`, `Config`.`Help`, `Config`.`Category`, `Config`.`Readonly`, `Config`.`Requires` FROM `zm`.`Config` AS `Config` WHERE `Config`.`Name` = 'ZM_OPT_USE_AUTH' LIMIT 1",
"params": [],
"affected": 1,
"numRows": 1,
"took": 0
},
{
"query": "SELECT `Config`.`Id`, `Config`.`Name`, `Config`.`Value`, `Config`.`Type`, `Config`.`DefaultValue`, `Config`.`Hint`, `Config`.`Pattern`, `Config`.`Format`, `Config`.`Prompt`, `Config`.`Help`, `Config`.`Category`, `Config`.`Readonly`, `Config`.`Requires` FROM `zm`.`Config` AS `Config` WHERE `Config`.`Name` = 'ZM_OPT_USE_AUTH' LIMIT 1",
"params": [],
"affected": 1,
"numRows": 1,
"took": 0
}
],
"count": 2,
"time": 0
}
}
}
}
Uncheck OPT_AUTH and it returns:
{
"version": "1.28.106",
"apiversion": "1.28.106.1"
}
Now, how do we get a user and password passed to the API?