This repository was archived by the owner on Jul 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 193
This repository was archived by the owner on Jul 24, 2023. It is now read-only.
Wrong user updated during login #257
Copy link
Copy link
Closed
Labels
Description
- Laravel Version: 5.4.12 and 5.1.9
- Adldap2-Laravel Version: 3.0.0
- PHP Version: 7.0.15
Description:
When having a single user in an active directory and using adldap2-laravel to authenticate, the user gets created / updated fine.
If I try another user from the AD, the first user created in the table gets updated.
See below log from MariaDB
66 Prepare select * from
users
limit 1
66 Execute select * fromusers
limit 1
66 Close stmt
66 Prepare updateusers
setname
= ?,username
= ?,password
= ?,updated_at
= ? whereid
= ?
66 Execute updateusers
setname
= 'Bo Bjørn',username
= 'bbjoern',password
= '$2y$10$TQBlVFSrX5t4jjRiYJwq5eAL2CSPrEe4AwjMJb1ZRiZ61z7AAgibq',updated_at
= '2017-02-16 08:52:47' whereid
= 1
Steps To Reproduce:
adldap_auth.php:
<?php
return [
'connection' => env('ADLDAP_CONNECTION', 'default'),
'provider' => Adldap\Laravel\Auth\DatabaseUserProvider::class,
'resolver' => Adldap\Laravel\Auth\Resolver::class,
'importer' => Adldap\Laravel\Auth\Importer::class,
'rules' => [
Adldap\Laravel\Validation\Rules\DenyTrashed::class,
],
'scopes' => [
Adldap\Laravel\Scopes\UpnScope::class,
],
'usernames' => [
'ldap' => 'samaccountname',
'eloquent' => 'username',
],
'login_fallback' => env('ADLDAP_LOGIN_FALLBACK', false),
'password_sync' => env('ADLDAP_PASSWORD_SYNC', true),
'windows_auth_attribute' => ['samaccountname' => 'AUTH_USER'],
'sync_attributes' => [
'email' => 'mail',
'name' => 'cn',
'username' => 'samaccountname'
],
];