Redirect with Remote auth

Forum for questions and support relating to the 1.30.x releases only.
Locked
baddroid
Posts: 2
Joined: Mon Sep 05, 2016 8:31 am
Location: Moscow, RU

Redirect with Remote auth

Post by baddroid »

Hi community!
Have installed ZM 1.30.0 (from iconnor ppa) on ubuntu 16.04 lxc. Configure remote auth via Kerberos.

There's one serious issue.
As I can see ZM can save GET request when not logged in user come to the server and add it to the base URL (/zm/index.php) after logging in.
When I configure builtin auth - that's OK. I go to the - http://server_address/zm/index.php?view=montage&group=0 - and get username & password form. I enter my builtin username and pass, hit submit and get redirect to the page i navigate - http://server_address/zm/index.php?view=montage&group=0.
BUT when I configure remote auth and navigate the same URL Apache authenticates with my Kerberos ticket and redirect me to the http://server_address/zm/index.php. I have a feeling that postLoginQuery variable that saves GET request doesn't save it.
Can anyone help me with my problem?
baddroid
Posts: 2
Joined: Mon Sep 05, 2016 8:31 am
Location: Moscow, RU

Re: Redirect with Remote auth

Post by baddroid »

Hi to all again!

OK. When I use builtin auth it process me to the login form from /usr/share/zoneminder/www/skins/classic/views/login.php
It saves my GET request's path in variable and after success auth sent me to URL http://server_address/zm/index.php?view=montage&group=0.

Now I go to use remote auth. I realize that it doesn't use code from /usr/share/zoneminder/www/skins/classic/views/login.php AND it hasn't variable to save my GET request's path. So I go to /usr/share/zoneminder/www/skins/classic/skin.php and change

Code: Select all

if ( !isset($user) && ZM_OPT_USE_AUTH && ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER']) )
{
     $view = "postlogin";
     $action = "login";
}
to

Code: Select all

if ( !isset($user) && ZM_OPT_USE_AUTH && ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER']) )
{
     $view = "postlogin";
     $action = "login";
+   $_REQUEST['username'] = $_SERVER['REMOTE_USER'];
}
And now when I go to http://server_address/zm/index.php?view=montage&group=0 Apache authenticates me by Kerberos ticket and passes me to the montage page.
Locked