使用PHP对AD进行身份验证

编程入门 行业动态 更新时间:2024-10-22 21:30:12
本文介绍了使用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中做了什么来实现这样的认证? 看看 www.php/w32api 。无论你在ASP中做什么,你都可以使用该API完全复制。 Kristian 免责声明:我不做窗户。

So what are you doing in ASP to enable such an authentication? Have a look at www.php/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_controllerpany" ;; ldap_server = "ad_controllerpany";

更多推荐

使用PHP对AD进行身份验证

本文发布于:2023-11-03 16:20:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555560.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:身份验证   PHP   AD

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!