2011-11-29 191 views
1

我们生产这些基于Linux的设备,我们希望与Active Directory集成。将Active Directory与第三方LDAP集成

我想知道如果下面的工作流程是可能的:

客户端安装我们的设备,得到它在网络上。 Windows系统管理员使用标准工具集中的某些东西将我们的设备添加为具有自定义抽象关于权限和权限的资源。

从器具的角度来看;凭借SysAdmin配置AD服务器(从而连接到它),Linux设备将能够使用该服务器作为身份验证代理,而无需Windows SysAdmin直接连接或配置设备。

所以基本上,这是一个插件解决方案,可以通过AD服务器以某种方式连接和验证它,从而为我们的技术添加新的抽象。

我没有真正的管理和配置公司IT的经验,所以我不知道这是否可能。谢谢你的帮助!

回答

1

插入适用于所有AD情况的解决方案几乎不存在!这通常是系统管理员的工作。

您的设备需要询问许多字段,例如服务器地址,服务器端口,使用SSL,代理代理(应用程序名称和应用程序DN),代理密码,基本DN和代理模式。

然后,您的应用程序应用程序,Java或PHP或其他应用程序需要实现LDAP协议,并执行身份验证检查。

我已经将企业LDAP与Wordpress和Mediawiki集成在一起(之前他们有插件),而且非常简单,只是没有即插即用。

我在PHP中使用了两个文件 - 一个使用设置,另一个使用auth函数。包括这两个在任何PHP应用程序,只是通过输入的用户名和密码,并返回与用户名称,电子邮件等信息的身份验证...

这是我创建一个测试页,当我第一次得到它所有的工作。

<html><body> 
<?php 

# Matt Hart - PHP-based authentication against active directory 
# Tested on Fedora Core 4 with Apache 2.0.54, PHP 4.3.11, OpenLDAP 
# OpenSSL, php-ldap 
# Working on RHEL4 

echo "<br>Attempting Secure LDAP Connection<br>"; 

// $mh_ldaphost = "ldaps://directory.yoursite.com:636"; 
$mh_ldaphost = "ldaps://ldap.yoursite.com:636"; 
$mh_ldapconn = ldap_connect($mh_ldaphost) or die ("Failed"); 
echo "<br>Succeeded ... Testing app binding<br>"; 

# Bind using app credentials 
$mh_appid = "yourappid"; // ****** Use your application id 
$mh_dn = "uid=" . $mh_appid . ",ou=Apps,o=Yoursite.com"; 
$mh_bind = ldap_bind($mh_ldapconn, $mh_dn) or die("Failed"); 
echo "<br>Succeeded ... Get user corp ID</br>"; 

# Get the user's corporate ID 
$mh_search = "ou=employees,ou=people,o=yoursite.com"; 
$mh_userid = "johnny"; // ****** User ID to find 
$mh_filter = "(uid=" . $mh_userid . ")"; 
$mh_search = ldap_search($mh_ldapconn, $mh_search, $mh_filter) or die ("Failed"); 
echo "<br>Succeeded: "; 
$mh_entries = ldap_get_entries($mh_ldapconn, $mh_search); 
$mh_corpid = $mh_entries[0]["corpidfield"][0]; 
echo "CorpID=" . $mh_corpid; 

# Authenticate the user 
echo "<br><br>Authenticating...<br>"; 

$mh_authdn = "corpidfield=" . $mh_corpid . ",ou=employees,ou=people,o=yoursite.com"; 
$mh_authpass = "Depp1"; // ****** User password 
$mh_authbind = ldap_bind($mh_ldapconn, $mh_authdn, $mh_authpass) or die("Failed"); 
die("Success"); 

?> 
</body></html> 

您还可以打印整个条目[]数组,以查看所有可能的返回结果。

+0

您的解决方案是开源的吗? – kristopolous

+0

添加了我创建的示例页面中的代码。你可以从应用版本看到它有多大!但它仍然可以在PHP5和最新的Active Directory服务器上正常工作。 –