adldap2 laravel它只返回'false'

问题描述 投票:0回答:1

我正在尝试使用adldap2访问adldap server

它与服务器一切正常,我使用Apache Directory Studio进行测试。

qazxsw poi但没有成功。我的所有请求都返回'false'或空集合。

我究竟做错了什么?

这是我的文件:

I have followed all these instructions

要直接测试我使用web.php:

# \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),

            ],

        ],

    ],

];

这是我的回复错误

<?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
1个回答
0
投票

如果您的查询或LDAP设置中存在错误,则会返回“false”。您可以尝试使用false response result函数获取错误。

在adldab2中,你的连接中应该有一个来自你的ldap_error的方法

Provider
© www.soinside.com 2019 - 2024. All rights reserved.