Closed pmirandaarias closed 6 years ago
adldap_auth.php:
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' => 'administrador',
'eloquent' => 'email',
],
'login_fallback' => env('ADLDAP_LOGIN_FALLBACK', false),
'password_sync' => env('ADLDAP_PASSWORD_SYNC', true),
'windows_auth_attribute' => ['samaccountname' => 'AUTH_USER'],
'sync_attributes' => [
'email' => 'userprincipalname',
'name' => 'cn',
],
adldap.php
'connections' => [
'default' => [
'auto_connect' => true,
'connection' => Adldap\Connections\Ldap::class,
'schema' => Adldap\Schemas\ActiveDirectory::class,
'connection_settings' => [
'account_prefix' => env('ADLDAP_ACCOUNT_PREFIX', ''),
'account_suffix' => env('ADLDAP_ACCOUNT_SUFFIX', '@redXXX.XXX.cl'),
'domain_controllers' => explode(' ', env('ADLDAP_CONTROLLERS', 'X.X.X.X')),
'port' => env('ADLDAP_PORT', 389),
'timeout' => env('ADLDAP_TIMEOUT', 5),
'base_dn' => env('ADLDAP_BASEDN', 'dc=redXXX,dc=XXX,dc=cl'),
'admin_account_suffix' => env('ADLDAP_ADMIN_ACCOUNT_SUFFIX', '@redXXX.XXX.cl'),
'admin_username' => env('ADLDAP_ADMIN_USERNAME', 'administrador'),
'admin_password' => env('ADLDAP_ADMIN_PASSWORD', 'XXX'),
'follow_referrals' => false,
'use_ssl' => false,
'use_tls' => false,
],
],
],
Hi, can you check your log? All users who can't be imported are logged with the exception.
Which log? Adldap log? or php, mysql
The Laravel log file stored in your applications storage
directory.
2018-01-24 13:33:16] production.ERROR: Unable to import user Alonso Arriagada Aguayo. SQLSTATE[42S22]: Column not found: 1054 Unknown column 'name' in 'field list' (SQL: insert into users
(email
, name
, password
, updated_at
, created_at
) values (aarriagada@redcne.cne.cl, Alonso Arriagada Aguayo, $2y$10$GTKVp.6aqny6ugA7r/qBKeMiMz6zP3H4rw3uYn0t2CDnvKUBNkZqK, 2018-01-24 13:33:16, 2018-01-24 13:33:16))
meh... I'm using "Laravel-boilerplate"... and the users table is like this:
Should I say goodbye to Adldap2? :( I need to connect to LDAP with this system...
Looks like your users table doesn't have a name
column and you're syncing a name column in your sync_attributes
.
The exception is clear on your issue, this isn't an Adldap2 problem, this is a configuration issue.
In that case, should I try to adding to
'sync_attributes' => [
'email' => 'userprincipalname',
'name' => 'cn',
],
The rest of attributes that I have on my table?
If you don't want your users to have a name, then you need to remove the name
key in your sync_attributes
array.
got it, it works. Thanks.
To anyone looking back on this, you could technically just change name
key in sync_attributes
array to:
'first_name' => 'givenname',
'last_name'=>'sn',
Description: I use the command
php artisan adldap:import someemail
, everything goes well, it found the user, then I put yes, yes. Then the last message isSuccessfully imported / synchronized 0 user(s).
Why is not importing the user? My provider is:
'provider' => Adldap\Laravel\Auth\DatabaseUserProvider::class,