在PHP中验证通过Active Directory使用LDAP [英] Authenticating in PHP using LDAP through Active Directory

查看:426
本文介绍了在PHP中验证通过Active Directory使用LDAP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找一种方法,通过LDAP用PHP来验证用户身份(使用Active Directory作为供应商)。理想情况下,应该能够在IIS 7上运行( adLDAP 做它在Apache)。任何人做过类似的话,成功?

I'm looking for a way to authenticate users through LDAP with PHP (with Active Directory being the provider). Ideally, it should be able to run on IIS 7 (adLDAP does it on Apache). Anyone had done anything similar, with success?

  • 编辑:我想preFER库/类code,它已经准备好去...这将会是愚蠢的发明轮子,当有人已经这样做了

推荐答案

导入全库似乎效率不高时,你需要的是本质上的两行code ...

Importing a whole library seems inefficient when all you need is essentially two lines of code...

$ldap = ldap_connect("ldap.example.com");
if ($bind = ldap_bind($ldap, $_POST['username'], $_POST['password'])) {
  // log them in!
} else {
  // error message
}

这篇关于在PHP中验证通过Active Directory使用LDAP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆