【发布时间】:2019-04-23 01:04:53
【问题描述】:
我正在尝试使用adldap2 访问adldap server。
服务器一切正常,我已经使用 Apache Directory Studio 对其进行了测试。
I have followed all these instructions 但没有成功。我所有的请求都返回“假”或空集合。
我做错了什么?
这是我的文件:
# \config\ldap.php
return [
'logging' => env('LDAP_LOGGING', false),
'connections' => [
'default' => [
'auto_connect' => env('LDAP_AUTO_CONNECT', true),
'connection' => Adldap\Connections\Ldap::class,
'settings' => [
'schema' => Adldap\Schemas\ActiveDirectory::class,
'account_prefix' => env('LDAP_ACCOUNT_PREFIX', ''),
'account_suffix' => env('LDAP_ACCOUNT_SUFFIX', ''),
'hosts' => explode(' ', env('LDAP_HOSTS', 'ldap.forumsys.com')),
'port' => env('LDAP_PORT', 389),
'timeout' => env('LDAP_TIMEOUT', 5),
'base_dn' => env('LDAP_BASE_DN', 'dc=example,dc=com'),
'username' => env(' cn=read-only-admin,dc=example,dc=com'),
'password' => env('password'),
'follow_referrals' => false,
'use_ssl' => env('LDAP_USE_SSL', false),
'use_tls' => env('LDAP_USE_TLS', false),
],
],
],
];
直接使用web.php测试我:
<?php
use Adldap\Laravel\Facades\Adldap;
Route::get('/api', function(){
$user = Adldap::search()->users()->find('newton');
dd($user);
return 'test page';
});
这是我的回复错误
【问题讨论】:
标签: php laravel ldap openldap adldap