I still have users table, and It has records.
I want to login users If they matched with their AD informations. If their AD informations not exist on my database, then create new record.
But Adldap2 always try to create new record If objectguId field is empty.
my ldap_auth.php file:
'ldap' => [
'locate_users_by' => 'userprincipalname',
'bind_users_by' => 'distinguishedname',
],
'database' => [
'guid_column' => 'objectguId',
'username_column' => 'username',
],
My LoginController:
$credentials = $request->only('username', 'password');
$aw = Auth::attempt($credentials);
if ($aw) {
$results = array('status' => 1, "message" => "Login success", "redirect" => "/");
}
Users logs in with his email and password. And successfully connects.
But It tries to create new record If no matching objectguId. So It returns "Duplicate entry" because this email was created on my database without objectguId.
I want It in case of email matches, so update record. If not, then create new record.
But couldnt solve for any.