php - LDAP authentification in Laravel -
i in charge of creating new laravel project authentication made our ldap. pretty new laravel excuse me lack of comprehension
i trying use library : adldap2-laravel
i followed this documentation build authentification scratch.
so config/app.php have lines added
//in providers array adldap\laravel\adldapserviceprovider::class, adldap\laravel\adldapauthserviceprovider::class, //in aliases 'adldap' => adldap\laravel\facades\adldap::class,
and config/auth.php (i tried use adldap driver, without success)
'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => app\user::class, ], 'users' => [ 'driver' => 'adldap', 'model' => app\user::class, ], ],
everything looks right. can not auth, have error : these credentials not match our records.
when use code
use adldap\laravel\facades\adldap; $username = "myuser"; $password = "mypassword"; if (adldap::auth()->attempt($username, $password)) { //queries here } else { echo "auth failed"; }
i can perform queries, , authentication works users. can not use login form behind "login" button.
did miss ?
i not know if authentication should work directly without importing tried run command
php artisan adldap:import
all users found , inserted in laravel db. authentication still not work.
i deleted adldap_account_suffix=
.env file
and added suffix directly in adldap_admin_username=administrator@mycompany.something
now i'm able connect via email address.
i not know if best solution @ least works.
i let post open few days see if have better idea
Comments
Post a Comment