Page 1 of 1

LDAP Authentication for Uploaders

PostPosted: Mon Apr 04, 2011 1:28 pm
by fels
Hello,

I would like to allow uploads for authenticated users only. Authentication should be done via a LDAP database,
where all allowed users can be found.

Greetings
Frank

Re: LDAP Authentication for Uploaders

PostPosted: Mon Apr 04, 2011 11:31 pm
by PeterS
fels wrote:Hello,

I would like to allow uploads for authenticated users only. Authentication should be done via a LDAP database,
where all allowed users can be found.

Greetings
Frank


What do you mean by a LDPA auth/database? Are you referring to a member's area where users can upload/manage their own files?

Re: LDAP Authentication for Uploaders

PostPosted: Mon Apr 11, 2011 12:32 pm
by fels
LDAP is a central directory service which helps to consolidate authentication as the directory service stores user names and passwords. The Microsoft name for LDAP is Active Directory, the Linux name is just LDAP.

There are extensions to Perl and PHP (php-ldap) and so on, that helps to authenticate a user against a LDAP database,
e.g. http://php.net/manual/en/book.ldap.php

--- piece of php code ---

<?php
$username = "jdoe";
$bindpw = "secret";
$ldapproxy = "ldaps://ldap-01.uos.de";
$ldapconn = ldap_connect($ldapproxy, 636)
or die("no conn");
if ($ldapconn) {
ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
$binddn = sprintf("uid=%s, ...);
$ldapbind = @ldap_bind($ldapconn, $binddn, $bindpw);
if ($ldapbind)
echo "user auth successful";
else
echo "user auth failed";
ldap_close($ldapconn);
}
?>
----


Regards Frank