Authentication against active directory

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
CaCtus491
Posts: 6
Joined: Mon Dec 05, 2005 3:32 am

Authentication against active directory

Post by CaCtus491 »

I'm trying to use the active directory provided by SBS2003 to authenticate ZM users so that users of the system can use a single password for all network services.

I have added an extra 'if' block around the existing authentication code which authenticates the supplied credentials against the active directory (using the ntlm_auth command).
I then took the password criteria out of the SQL statement. (see code below)

I have done things this way as it required minimal changes, allowing me to continue using the permissions system of ZM.

Can anyone suggest a better way to achieve this? I've really just made a quick hack to get it going.

Cheers,
-Kent

The following code was modified around line 40 of zm_funcs.php:

Code: Select all

exec('/usr/bin/ntlm_auth --username=' . escapeshellarg($username) . ' --password=' . escapeshellarg($password), $stdOut, $result);
        if ($result == 0) {
                $sql = "select * from Users where Username = '".mysql_escape_string($username)."' and Enabled = 1";
                $result = mysql_query( $sql );
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

If you can get a username into the HTTP_REMOTE_USER environment variable you can use ZM remote authentication. But other than that what you have done seem sensible. If I can think of a generic way to include this then I will include it in the main distro.

Phil
User avatar
theorganloft
Posts: 29
Joined: Fri Mar 14, 2008 12:29 pm
Location: Atlanta, Georgia, USA

Post by theorganloft »

zoneminder wrote:If you can get a username into the HTTP_REMOTE_USER environment variable you can use ZM remote authentication. But other than that what you have done seem sensible. If I can think of a generic way to include this then I will include it in the main distro.

Phil
Have any improvements been made on this?
wasabi
Posts: 9
Joined: Sat Sep 24, 2005 3:52 pm

Post by wasabi »

You can use mod_auth_kerb to accomplish this.
Post Reply