【发布时间】:2014-06-26 20:40:29
【问题描述】:
我已经按照https://github.com/ccovey/ldap-auth 上的所有安装说明尝试使用 Laravel 4.1 进行 LDAP 身份验证。
adldap.php
return array(
'account_suffix' => "@xxxxxxx.xxx.xxx",
'domain_controllers' => array("dc01.xxxxxxx.xxx.xxx"),
'base_dn' => 'DC=xxxxxxxx,DC=xxx,DC=xxx',
);
现在,如果我保留上面的 adldap.php 文件并运行以下 route.php 文件
Route::get('/', function()
{
$credentials = array(
'username' => 'username',
'password' => 'password'
);
if($a = Auth::attempt($credentials))
{
return '<pre>' . print_r(Auth::user(), true);
}
else
{
dd($a);
}
});
我得到以下输出
bool(false)
这似乎没有意义,因为我使用了正确的用户名/密码。在从 MSSQL 运行 ADSI 时,我也在域和 DC 方面使用相同的配置,所以我知道它可以工作。
现在,如果我更改 adldap.php 文件以包含 admin_username, admin_password 我在 laravel.log 中收到以下错误
'Bind to Active Directory failed. Either the LDAPs connection failed or the login credentials are incorrect. AD said: Can't contact LDAP server'
有什么建议吗?提前致谢。
【问题讨论】: