Adldap2-Laravel icon indicating copy to clipboard operation
Adldap2-Laravel copied to clipboard

Adldap not working after upgrading to Laravel 6

Open barmania opened this issue 3 years ago • 0 comments

  • Laravel Version: 6.20.44 upgrading from 5.8
  • Adldap2-Laravel Version: 6.1.6 upgrading from 3.0.*
  • PHP Version: 7.4
  • LDAP Type: ActiveDirectory

Hi, i'm trying to upgrade my Laravel backend to version 6, and it requires me to upgrade Adldap2-Laravel aswell, but after doing so following the upgrade guide it doesn't work anymore. It does seem to connect to my AD server, because when I change LDAP_HOST settings it returns 'can't connect to ldap server'. But when querying for users, it just returns an empty array. Here's my config:

.env:

LDAP_ACCOUNT_PREFIX="internal\\"
LDAP_ACCOUNT_SUFFIX=
LDAP_BASE_DN="OU=BLAAT,dc=INTERNAL,dc=BLAAT,dc=nl"
LDAP_HOSTS=s-hdc1.example.nl
LDAP_PORT=389
LDAP_USE_SSL=true
LDAP_ADMIN_USERNAME="user"
LDAP_ADMIN_PASSWORD="password"
LDAP_PASSWORD_SYNC=true

config\auth.php:

'providers' => [
        'users' => [
            'driver' => 'mixed',
            'model' => App\Models\User::class,
            'use_adldap' => !empty(env('LDAP_HOSTS', null))
        ],
    ],

the code i use to get users:

$users = Adldap::search()->users()->get();
\Log::Info($users);

I've allready tried republishing the config files (which genereates config/ldap.php and config/ldap_auth.php) and going through each setting to see what has changed compared to the older version of Adldap2-Laravel. Kind of at a loss here, and help is greatly appreciated. Let me know if more examples of files are needed. Thanks

barmania avatar Jul 07 '22 10:07 barmania