Adldap2 / Adldap2-Laravel

LDAP Authentication & Management for Laravel
MIT License
911 stars 184 forks source link

named connection not being used #521

Open gbryant200 opened 6 years ago

gbryant200 commented 6 years ago

I named my connection in the adldap.php file's 'connections' array and added a second connection with a different name. I modifed my adldap_auth.php file's 'connection' array value to use the second connection in my 'connections' array but it is always using the first connection. I swapped the named connections in the 'connections' array to make the 2nd listed connection first in the array and then it was used.

adldap.php:

return [
     'connections' => [
        'Process Control' => [...],
        'Biznet' => [...],
    ],
];

adldap_auth.php:

   //'connection' => env('ADLDAP_CONNECTION', 'Process Control'),
    'connection' => 'Biznet',

still used the 'Process Control' connection; swapped Process Control and Biznet positions in the adldap.php 'connections' and then the Biznet connection items were used.

I have complete control of the Process Control domain and connect/authenticate as expected. Now I'm moving to our corporate domain (no admin access) and would like to use the env ADLDAP_CONNECTION value to switch between the 2 for testing. I'd like to eventually have our corporate users to auto-login when they use the web-site.

I'm not currently trying to authenticate with multiple domains (maybe eventually but not now).

It appears to use the first 'connections' (dd the $connection, $configuration) but it doesn't authenticate with that connection. So maybe the second connection isn't correct so it tries the first?

stevebauman commented 6 years ago

Hi @gbryant200, going to take a look into this today, thanks for the report!

stevebauman commented 6 years ago

Also just before I investigate and give this a go, can you try clearing your configurations cache (using the command php artisan cache:clear) to make sure it's not the issue?

gbryant200 commented 6 years ago

FYI - clearing the cache didn't help

stevebauman commented 6 years ago

Thanks for trying @gbryant200, appreciate it, will have more information today.