Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Wrong user updated during login #257

@Swiff

Description

@Swiff
  • 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 * from users limit 1
66 Close stmt
66 Prepare update users set name = ?, email = ?, username = ?, password = ?, updated_at = ? where id = ?
66 Execute update users set name = 'Bo Bjørn', email = '[email protected]', username = 'bbjoern', password = '$2y$10$TQBlVFSrX5t4jjRiYJwq5eAL2CSPrEe4AwjMJb1ZRiZ61z7AAgibq', updated_at = '2017-02-16 08:52:47' where id = 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'
    ],
];

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions