0

I have an ssh access to a LDAP server.

After accessing through ssh I can access to phpldapadmin. I have an admin DN and a password.

What needs to be done is I have to authenticate users using ldap whenever they try to login to a website.

Website is using jaggery for the server side code. But php is okay too.

I haven't worked with ldap and ssh. So if somebody can help on this I'll really appreciate it.

4

2 回答 2

0

您必须在此处下载 adLDAP.php:http: //adldap.sourceforge.net/download.php

然后autentication很简单:

$adldap = new adLDAP(array('base_dn'=>'DC=domainexample,DC=suffixexample', 'account_suffix'=>'@domainexample.suffix'));
$authUser = $adldap->authenticate('user', 'password');
if ($authUser == true) {
  echo "User authenticated successfully<br>";
}
else {
  echo "User authentication unsuccessful<br>";
}

您只需注意 DC 属性:它取决于 LDAP 网络。

于 2014-02-04T13:37:01.830 回答
0

PHP 有一个与 LDAP 一起工作的扩展。您不需要安装第三方库。

使用 ldap 和 session 是您所需要的。

http://us2.php.net/manual/pt_BR/book.ldap.php

于 2014-02-04T13:42:13.290 回答