• <bdo id='MqJq7'></bdo><ul id='MqJq7'></ul>
    <legend id='MqJq7'><style id='MqJq7'><dir id='MqJq7'><q id='MqJq7'></q></dir></style></legend>

    <small id='MqJq7'></small><noframes id='MqJq7'>

    <i id='MqJq7'><tr id='MqJq7'><dt id='MqJq7'><q id='MqJq7'><span id='MqJq7'><b id='MqJq7'><form id='MqJq7'><ins id='MqJq7'></ins><ul id='MqJq7'></ul><sub id='MqJq7'></sub></form><legend id='MqJq7'></legend><bdo id='MqJq7'><pre id='MqJq7'><center id='MqJq7'></center></pre></bdo></b><th id='MqJq7'></th></span></q></dt></tr></i><div id='MqJq7'><tfoot id='MqJq7'></tfoot><dl id='MqJq7'><fieldset id='MqJq7'></fieldset></dl></div>

        <tfoot id='MqJq7'></tfoot>

        在使用 IE/Firefox 时使用 PHP、活动目录对 ldap 进行身份验证

        Authenticate against ldap using PHP, active directory, while using IE/Firefox(在使用 IE/Firefox 时使用 PHP、活动目录对 ldap 进行身份验证)
      1. <i id='WBg8H'><tr id='WBg8H'><dt id='WBg8H'><q id='WBg8H'><span id='WBg8H'><b id='WBg8H'><form id='WBg8H'><ins id='WBg8H'></ins><ul id='WBg8H'></ul><sub id='WBg8H'></sub></form><legend id='WBg8H'></legend><bdo id='WBg8H'><pre id='WBg8H'><center id='WBg8H'></center></pre></bdo></b><th id='WBg8H'></th></span></q></dt></tr></i><div id='WBg8H'><tfoot id='WBg8H'></tfoot><dl id='WBg8H'><fieldset id='WBg8H'></fieldset></dl></div>

      2. <small id='WBg8H'></small><noframes id='WBg8H'>

            <tbody id='WBg8H'></tbody>
              • <bdo id='WBg8H'></bdo><ul id='WBg8H'></ul>
                <legend id='WBg8H'><style id='WBg8H'><dir id='WBg8H'><q id='WBg8H'></q></dir></style></legend>
                <tfoot id='WBg8H'></tfoot>

                  本文介绍了在使用 IE/Firefox 时使用 PHP、活动目录对 ldap 进行身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  下面的代码会根据 ldap 检查用户的凭据

                  This code below checks for the user's credentials against ldap

                  <?php
                  $ldaphost = "ldap.domain.com";
                  $ldapport = 389;
                  
                  $ds = ldap_connect($ldaphost, $ldapport)
                  or die("Could not connect to $ldaphost");
                  
                  if ($ds) 
                  {
                      $username = "johndoe@domain.com";
                      $upasswd = "pass";
                  
                      $ldapbind = ldap_bind($ds, $username, $upasswd);
                  
                      if ($ldapbind) 
                          {print "Congratulations! $username is authenticated.";}
                      else 
                          {print "Access Denied!";}
                  }
                  ?>
                  

                  我的用户使用 Firefox 和 IE,我知道它们可以无缝传递他们的 ActiveDirectory 凭据.

                  My users use Firefox and IE, and I know that can pass their ActiveDirectory credentials seamlessly.

                  我只想检查 AD 组,看看那里是否找到了该用户名,如果是,则显示页面,否则提示输入凭据.

                  I just want to check the AD group to see if that username is found in there, if so, display the page, otherwise prompt to enter in credentials.

                  由于我们的用户已经登录到域控制器,我想获取他们的用户名,检查是否在特定组中找到它,然后让他们进入,否则提示用户输入凭据.这怎么可能?

                  Since our users are already logged into the domain controller, I want to grab their username, check to see if it was found in the specific group, then let them in, otherwise prompt user to input credentials. How is this possible?

                  推荐答案

                  实际上你不需要通过你的 PP 代码与 Active Directory 服务器通信来实现你想要的,因为你使用 IIS 作为你的 web 服务器.

                  You actually do not need to communicate with the Active Directory server from your PP code to achieve what you want given the fact that you use IIS as your web server.

                  这里的关键词是 集成 Windows 身份验证 - 那就是djn 寻找的措辞.如果启用此选项(并且拒绝匿名访问),IIS 将根据 Active Directory 和所请求资源的 NTFS 文件系统权限检查提供的凭据.因此,您可以使用简单的 NTFS 访问控制机制来控制对文件的访问.

                  The key word here is Integrated Windows Authentication - that's the wording djn looked for. If this option is turned on (and anonymous access is denied) IIS will check the supplied credentials against the Active Directory and the NTFS filesystem privileges of the requested resources. You can therefore control access to your files using simple NTFS access control mechanisms.

                  如果您的用户使用 IE,他们甚至不必输入他们的凭据,因为这是通过所谓的 SPNEGO(简单且受保护的 GSSAPI 协商机制)及其底层机制 Kerberos 或 NTLMSSP 取决于您的客户端和服务器能够处理的内容.

                  If your users use IE they even don't have to type in their credentials as this is done automatically via so called SPNEGO (Simple and Protected GSSAPI Negotiation Mechanism) and its underlying mechanisms Kerberos or NTLMSSP depending on what your client and server is capable of processing.

                  据我所知,Firefox 也能够自动将 Windows 登录凭据移交给您的服务器.您只需将 配置选项 调整为启用该功能 - 不知道此信息在 Firefox 3.5.x 中是否仍然有效.

                  As far as I know Firefox is able to hand over the Windows logon credentials to your server automatically too. You ony have to adjust a configuration option to turn on that feature - don't know if this information is still valid with Firefox 3.5.x.

                  如果您在 *nix 系统上运行 Apache,您将不得不求助于一些服务器端模块来处理类似 集成 Windows 身份验证的系统.可能的选项是(不知道它们实际上是否仍然保持或稳定):

                  If you're running Apache on a *nix-system you'll have to resort to some server-side-module to handle a Integrated Windows Authentication-like system. Possible options are (don't know whether they are actually still maintained or stable):

                  • mod_auth_ntlm_winbind
                  • mod_auth_kerb
                  • mod_ntlm

                  对于 Windows 上的 Apache,有:

                  For Apache on Windows there are:

                  • mod_ntlm(过时;不同上面的mod_ntlm)
                  • mod_auth_sspi(<代码>mod_ntlm)

                  请注意,这些模块中的大多数似乎都已经很旧了.

                  Please be aware that most of these modules seem to be very old.

                  这篇关于在使用 IE/Firefox 时使用 PHP、活动目录对 ldap 进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  smtp gmail server php mailer not working(smtp gmail服务器php邮件程序不工作)
                  Email goes in spam when I send it via others SMTP server(当我通过其他 SMTP 服务器发送电子邮件时,电子邮件进入垃圾邮件)

                  <i id='vuQpb'><tr id='vuQpb'><dt id='vuQpb'><q id='vuQpb'><span id='vuQpb'><b id='vuQpb'><form id='vuQpb'><ins id='vuQpb'></ins><ul id='vuQpb'></ul><sub id='vuQpb'></sub></form><legend id='vuQpb'></legend><bdo id='vuQpb'><pre id='vuQpb'><center id='vuQpb'></center></pre></bdo></b><th id='vuQpb'></th></span></q></dt></tr></i><div id='vuQpb'><tfoot id='vuQpb'></tfoot><dl id='vuQpb'><fieldset id='vuQpb'></fieldset></dl></div>

                  <small id='vuQpb'></small><noframes id='vuQpb'>

                1. <legend id='vuQpb'><style id='vuQpb'><dir id='vuQpb'><q id='vuQpb'></q></dir></style></legend>

                      <tbody id='vuQpb'></tbody>

                        <bdo id='vuQpb'></bdo><ul id='vuQpb'></ul>
                          • <tfoot id='vuQpb'></tfoot>