Closed hakihosting closed 7 months ago
Hi @hakihosting,
This error means you do not have a provider named ldap
inside of your config/auth.php
file. Try using:
php artisan ldap:import users
If you still receive an error, please make sure you've followed the configuration steps in the documentation here:
https://ldaprecord.com/docs/laravel/v3/auth/database/configuration
Hello thank you for the command i try it :) it works but i have this message. Allowed memory size of 134217728 bytes exhausted (tried to allocate 221184 bytes)
Hi @hakihosting,
Please try the --chunk
option mentioned here to prevent memory issues:
https://ldaprecord.com/docs/laravel/v3/auth/database/importing/#chunk
Thanks but i have another problem : Call to undefined method App\Models\User::getLdapGuidColumn()
Hi @hakihosting,
Please add the AuthenticatesWithLdap
trait onto your App\Models\User
model:
// ...
use LdapRecord\Laravel\Auth\AuthenticatesWithLdap;
class User extends Authorizable
{
// ...
use AuthenticatesWithLdap;
}
Then re-run the import again.
I do the change when i launch the command i have this log : Would you like these users to be imported / synchronized? (yes/no) [yes]:
y
1/1 [============================] 100% Successfully imported / synchronized [0] user(s).
Why 0 users
But nothing it imported or synchronized
Hi @hakihosting,
Check your base_dn
in your LDAP configuration to ensure it's properly set to the root of your domain.
Besides that, this is something you'll have to investigate further, as I don't have access to your environment to debug.
It works but it not syncronized or imported :
PS C:\Users\p4479562\PhpstormProjects\5344 - Mydesk> php artisan ldap:import users neji
Found user [CN=Heyckel NEJI].
Would you like to display the user(s) to be imported / synchronized? (yes/no) [no]:
y
+-----------------------------------------------------------------------------+--------------------+ | Name | Distinguished Name | +-----------------------------------------------------------------------------+--------------------+ | CN=Heyckel NEJI,OU=Telemat,OU=Internal,OU=Users,OU=PZBN,DC=ZPZ5344,DC=local | CN=Heyckel NEJI | +-----------------------------------------------------------------------------+--------------------+
Would you like these users to be imported / synchronized? (yes/no) [yes]:
y
1/1 [============================] 100% Successfully imported / synchronized [0] user(s). PS C:\Users\p4479562\PhpstormProjects\5344 - Mydesk>
Aut.php
'users' => [ 'driver' => 'ldap', 'model' => LdapRecord\Models\ActiveDirectory\User::class, 'rules' => [], 'database' => [ 'model' => App\Models\User::class, 'sync_passwords' => true, 'sync_attributes' => [ 'name' => 'sAMAccountName', 'email' => 'mail', ], 'sync_existing' => [ 'name' => 'sAMAccountName', 'email' => 'mail', 'guid' => 'guid', 'domain' => 'domain', ], ],
],
Hi @hakihosting,
If importing fails, please check the storage/logs
directory in your application and read the last printed exceptions, as it will display the cause of failure.
Hello i have look the log : Failed importing object [Heyckel NEJI]. SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicata du champ
So the recors already exist in the table but i would like to syncronized it but they don't to because they already exist. How i can syncronized it if the date exist.
Ok i found :) now i can syncronized. The field password is the same paswoord set on the AD ?
I think when it s imported they create a new password , is not the password in the AD.
I think when it s imported they create a new password , is not the password in the AD.
Yes this is correct: https://ldaprecord.com/docs/laravel/v3/auth/database/importing/#password-synchronization
Ok and how can i do for the login.The user set the email and the password of AD.How can i do that ?Envoyé à partir de Outlook pour Android
Some response ?
Environment:
Describe the bug: when i launch php artisan ldap:import i have this error : Provider [ldap] does not exist.