使用PHP对AD进行身份验证 [英] Use PHP to authenticate to AD

查看:118
本文介绍了使用PHP对AD进行身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

听起来很奇怪,但是我走了。


我们使用Windows 2000 AD来处理所有事情。但是,我们还在Windows机器上运行了

XAMPP(基本上是Apache,MySQL,用于Windows的PHP),用于我们的Intranet。我有几个应用程序需要通过PHP验证来自
AD,我看到的每个例子都使用内置的

PHP中的LDAP函数。


我无法通过LDAP查询我们的AD服务器。如果我键入

ldap:// domaincontroller它失败了,所以当然我尝试在PHP中使用

LDAP函数时它们会失败。


如何在AD上运行LDAP?我肯定我错过了一些简单的东西,但是我很沮丧。


BTW,我已经开始编码了另一个使用ASP查询AD的应用程序

太容易受伤了。

Going to sound strange, but here i go.

We use Windows 2000 AD for everything. However, we are also running
XAMPP (basically Apache, MySQL, PHP for windows) on a Windows box for
our Intranet. I have a few applications that need to authenticate via
AD from PHP and every example I see uses the LDAP functions built into
PHP.

I cannot query our AD server via LDAP. If I type
ldap://domaincontroller it fails, so of course, when I try to use the
LDAP function in PHP they fail.

How do I get LDAP running on AD? I''m sure I''m missing something simple,
but I''m very frustrated.

BTW, I''ve started coding another app that queries AD using ASP and it
is soooo easy it hurts.

推荐答案

Bonegavel写道:
Bonegavel wrote:
BTW,我已经开始编写另一个使用ASP查询AD的应用程序,它很容易受到伤害。
BTW, I''ve started coding another app that queries AD using ASP and it
is soooo easy it hurts.




那么你在ASP中做了什么来实现这样的认证?


看看 http://www.php.net/w32api 。无论你在ASP中做什么,你都可以使用该API完全复制。


Kristian


免责声明:我不做窗户。



So what are you doing in ASP to enable such an authentication?

Have a look at http://www.php.net/w32api. Whatever you are doing in ASP, you
should be able to duplicate exactly using that API.

Kristian

DISCLAIMER: I don''t do windows.


Bonegavel写道:
Bonegavel wrote:
听起来很奇怪但是我走了。

我们使用Windows 2000 AD来处理所有事情。但是,我们还在Windows机顶盒上运行XAMPP(基本上是Apache,MySQL,用于Windows的PHP),用于我们的Intranet。我有一些应用程序需要通过PHP从AD进行身份验证,我看到的每个示例都使用PHP内置的LDAP函数。

我无法通过LDAP查询我们的AD服务器。如果我输入ldap:// domaincontroller它就会失败,当然,当我尝试在PHP中使用
LDAP函数时,它们会失败。

如何让LDAP运行在广告?我确定我错过了一些简单的东西,但是我非常沮丧。

顺便说一下,我已经开始编写另一个使用ASP查询AD的应用程序了
非常容易受伤。
Going to sound strange, but here i go.

We use Windows 2000 AD for everything. However, we are also running
XAMPP (basically Apache, MySQL, PHP for windows) on a Windows box for
our Intranet. I have a few applications that need to authenticate via
AD from PHP and every example I see uses the LDAP functions built into
PHP.

I cannot query our AD server via LDAP. If I type
ldap://domaincontroller it fails, so of course, when I try to use the
LDAP function in PHP they fail.

How do I get LDAP running on AD? I''m sure I''m missing something simple,
but I''m very frustrated.

BTW, I''ve started coding another app that queries AD using ASP and it
is soooo easy it hurts.




我们为此做的是使用通用帐户进行绑定,搜索

然后sAMAccountName尝试使用该DN和提供的

密码重新绑定。如果绑定有效,用户/密码是正确的,如果它是/ b $ b,用户不会再次忘记他们的密码。


这是在Linux上,对Windoze一无所知,所以这可能对你来说不一样了。


例如



What we do for this is to bind using a generic account, search for the
sAMAccountName then attempt to rebind using that DN and the supplied
password. If the bind works, the user/password is correct, if it
doesn''t the users forgotten their password again.

This is on Linux, don''t know anything about Windoze, so this might be
different for you!

e.g.


ldap_server =" ad_controller.company.com" ;;
ldap_server = "ad_controller.company.com";


这篇关于使用PHP对AD进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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