Closed alanTaiariol closed 1 year ago
Hi @alanTaiariol,
Password synchronization only occurs when an LDAP user successfully logs into your application.
It is not possible to retrieve a pure-text copy of the user's password from your LDAP server during import.
This is described in the documentation here:
https://ldaprecord.com/docs/laravel/v2/auth/database/importing/#password-synchronization
hi Steve, how I can synchronice to my database the user AD password when a user has a succesfully logged in my application?
Environment:
Describe the bug: The compare of the login request password with active directory user imported password fail, I think that this happens because the password hashed that was imported to my database is a random password maked by Str::ramdom. I check with tinker -> hash:check() and I get a false result.
In auth.php file I'm setting the provider's array like this
'ldap' => [ 'driver' => 'ldap', 'model' => LdapRecord\Models\ActiveDirectory\User::class, 'rules' => [], 'database' => [ 'model' => App\User::class, 'sync_passwords' => true, 'sync_attributes' => [ 'name' => 'cn', 'email' => 'mail', ], 'sync_existing' => [ 'email' => 'email', ], 'password_column' => 'password', ],
and I'm importing the user AD to my database like this:
`
use LdapRecord\Laravel\Import\UserSynchronizer as Synchronizer; $me = JWTAuth::user(); // agregar validacion contra db $option = Option::select("ad_scheme_attribute")->where('client_id', $me->entity_id)->firstOrFail();