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

Commit 2aa9878

Browse files
committed
Doc tweaks and fixes.
1 parent 76ea3be commit 2aa9878

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

docs/auth.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ echo $user->email;
338338
The `NoDatabaseUserProvider` allows you to authenticate LDAP users without synchronizing them.
339339

340340
> **Note**: Due to Laravel's generated blade views with the `auth:make` command, any
341-
> views that utilize Eloquent User model attributes, you will have to re-write some
342-
> of these views for compatibility if you utilize this provider.
341+
> views that utilize Eloquent User model attributes will need to be
342+
> re-written for compatibility with this provider.
343343
>
344344
> For example, in the generated `resources/views/layouts/app.blade.php`, you will
345345
> need to rewrite `Auth::user()->name` to `Auth::user()->getCommonName();`
@@ -385,15 +385,15 @@ then these will feel very similar.
385385

386386
To create a scope, it must implement the interface `Adldap\Laravel\Scopes\ScopeInterface`.
387387

388-
For this example, we'll create a folder inside our `app` directory containing our scope named `Scopes`.
388+
For this example, we'll create a folder inside our `app` directory containing our scope named: `Scopes`.
389389

390390
Of course, you can place these scopes wherever you desire, but in this example, our final scope path will be:
391391

392392
```
393393
../my-application/app/Scopes/AccountingScope.php
394394
```
395395

396-
With this scope, we want to only allow members of an Active Directory group named `Accounting`:
396+
With this scope, we want to only allow members of an Active Directory group named: `Accounting`:
397397

398398
```php
399399
namespace App\Scopes;
@@ -443,7 +443,8 @@ to authenticate with users that are a member of the `Accounting` group.
443443

444444
All other users will be denied authentication, even if their credentials are valid.
445445

446-
> **Note**: If you're caching your configuration files, make sure you run `php artisan config:clear`.
446+
> **Note**: If you're caching your configuration files, make sure you
447+
> run `php artisan config:clear` to be able to use your new scope.
447448
448449
### Rules
449450

@@ -462,14 +463,14 @@ contains the LDAP user model, as well as their Eloquent `$model`
462463
463464
We'll create a folder in our `app` directory containing our rule named `Rules`.
464465

465-
With this example rule, we only want to allow users to authenticate that are inside specific OU's.
466+
With this example rule, we only want to allow users to login if they are inside specific OU's:
466467

467468
```php
468469
namespace App\Rules;
469470

470471
use Adldap\Laravel\Validation\Rules\Rule;
471472

472-
class OuRule extends Rule
473+
class OnlyManagersAndAccountingRule extends Rule
473474
{
474475
/**
475476
* The LDAP user.
@@ -508,22 +509,14 @@ To implement your new rule, you just need to insert it into your `config/adldap_
508509

509510
```php
510511
'rules' => [
511-
512-
// Denys deleted users from authenticating.
513-
514-
Adldap\Laravel\Validation\Rules\DenyTrashed::class,
515-
516-
// Allows only manually imported users to authenticate.
517-
518-
// Adldap\Laravel\Validation\Rules\OnlyImported::class,
519512

520-
App\Rules\OuRule::class,
513+
App\Rules\OnlyManagersAndAccountingRule::class,
521514

522515
],
523516
```
524517

525-
Now when you try to authenticate, you will either need to be logging in with an LDAP user with the last name of `Doe` or
526-
with a local database record that was created after 2016.
518+
Now when you try to login, the LDAP user you login with will need to be
519+
apart of either the `Accounting` or `Managers` Organizational Unit.
527520

528521
#### Example Rules
529522

0 commit comments

Comments
 (0)