Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
code:laravel:ldap [2020/04/16 08:42] – [Laravel AD LDAP] gerardorourkecode:laravel:ldap [2020/04/26 10:46] (current) – [Removing the Password column] gerardorourke
Line 99: Line 99:
  
 ==== Importing Users==== ==== Importing Users====
-<code>php artisan ldap:import ldap --filter "(objectclass=user)"</code>+ 
 +  *Use the **--delete** option to soft delete users who have been disabled 
 +  *Use the **--delete-missing** option to delete any users not found (because they have been deleted on the AD) - be careful if not found in filter - then all existing users could be soft deleted! (can restore if necessary using a simple SQL query). 
 +  *Use the **--restore** option to un-softdelete a user if they have been reenabled. 
 + 
 +<code>php artisan ldap:import ldap --filter "(objectclass=user)" --delete-missing --delete --restore</code>
  
 Sync any users who are **Enabled** Sync any users who are **Enabled**
Line 190: Line 195:
 </code> </code>
   *If you are caching your configuration, make sure you re-run **config:cache** to re-cache your modifications.   *If you are caching your configuration, make sure you re-run **config:cache** to re-cache your modifications.
 +
 +
 +===== Removing the Password column =====
 +
 +Using the option <code> 'password_column' => false </code> allows you to remove the password column from the users table.
 +Reference: https://ldaprecord.com/docs/laravel/auth/configuration/#database-password-sync
 +
 +<code php>
 +    'providers' => [
 +
 +        'ldap' => [
 +            'driver' => 'ldap',
 +            'model' => LdapRecord\Models\ActiveDirectory\User::class,
 +            'database' => [
 +                'password_column' => false, 
 +                'model' => App\User::class,
 +                'sync_attributes' => [
 +                    'name' => 'cn',
 +                    'username' => 'samaccountname',
 +                ],
 +            ],
 +        ],
 +    ],
 +</code>
  • code/laravel/ldap.1587022973.txt.gz
  • Last modified: 2020/04/16 08:42
  • by gerardorourke