Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit 2d2d5d0

Browse files
committed
Added note about missing objectguid and a modified username
1 parent 8fd98f0 commit 2d2d5d0

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

docs/auth/setup.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,13 @@ You can ignore the `windows` configuration array, unless you're planning on usin
336336

337337
### GUID Column
338338

339-
The GUID column is a new configuration option added in v6.0 that allows to set the database column that will store users Object GUID (Globally Unique Identifier). The addition of this database column allows you to make username changes in your LDAP directory, and have them properly synchronize in your Laravel application. This is usually the scenario when someone changes their marital status, or changes their name.
339+
The GUID column is a new configuration option added in v6.0 that allows you to set the
340+
database column that will store users Object GUID (Globally Unique Identifier).
341+
342+
The addition of this database column allows you to make username changes in your
343+
LDAP directory, and have them properly synchronize in your Laravel application.
344+
345+
This is usually the scenario when someone changes their marital status, or changes their name.
340346

341347
If you're upgrading from a previous Adldap2-Laravel version, simply create a new migration and add the `nullable` column to your `users` database table.
342348

@@ -363,7 +369,9 @@ Schema::create('users', function (Blueprint $table) {
363369
});
364370
```
365371

366-
If you have user records already inside your database with a `null` `objectguid` value, then **it will be set automatically** if a user authenticates with the same username that is contained in your configured in your `username_column` option.
372+
If you have user records already inside your database with a `null` `objectguid` value, then
373+
**it will be set automatically** if a user authenticates with the same username that
374+
is contained in your configured in your `username_column` option.
367375

368376
For example, lets say we have a user in our database with the following information:
369377
```
@@ -386,6 +394,15 @@ When a user successfully authenticates with the username of `[email protected]`, the
386394
The next time this user authenticates, the `objectguid` will queried for **first**, then `email`.
387395
This is done using a simple `or where` statement, so two queries are not executed for one login.
388396

397+
> **Note**: If the users identifier changes (their email / username) prior to their
398+
> `objectguid` from being synchronized to your local database and they login to
399+
> your application, a new user record will be created.
400+
>
401+
> This is due to not being able to locate a local user record with the users new username.
402+
>
403+
> It is recommended to keep your application in sync via scheduling the `adldap:import`
404+
> command so that all users have a synchronized `objectguid`.
405+
389406
### Username Column
390407

391408
The `username_column` contains a value that should match the username column you have set up in your `users` database table.

0 commit comments

Comments
 (0)