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

Commit d8d1822

Browse files
committed
Implemented docs for events
1 parent 68deaba commit d8d1822

File tree

1 file changed

+62
-11
lines changed

1 file changed

+62
-11
lines changed

docs/auth.md

Lines changed: 62 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -653,17 +653,68 @@ This feature is disabled by default.
653653

654654
### Events
655655

656-
There are several events fired during each operation that takes place in Adldap2-Laravel.
657-
658-
| Event | Fired | Limitations |
659-
|----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|
660-
| `Adldap\Laravel\Events\AuthenticatedModelTrashed` | When the configured authentication rule `Adldap\Laravel\Validation\Rules\DenyTrashed` is used, this event will be fired when a user has passed LDAP authentication, but their Eloquent model has been soft deleted. | |
661-
| `Adldap\Laravel\Events\AuthenticatedWithCredentials` | When a user successfully passes LDAP authentication. | |
662-
| `Adldap\Laravel\Events\AuthenticatedWithWindows` | When a user has authenticated successfully using the `WindowsAuthenticate` middleware. | |
663-
| `Adldap\Laravel\Events\DiscoveredWithCredentials` | When a users LDAP record has been successfully been found. Fired before LDAP authentication. | |
664-
| `Adldap\Laravel\Events\Importing` | When an LDAP user is being imported for the first time. Not fired on subsequent logins after being imported. Use the `Synchronized` / `Synchronizing` event for this purpose. | Only fired when using the `DatabaseUserProvider` |
665-
| `Adldap\Laravel\Events\Synchronizing` | When an LDAP users attributes are being synchronized. Fired on every authentication attempt after the LDAP user has been located. | Onlyfired when using the `DatabaseUserProvider` |
666-
| `Adldap\Laravel\Events\Synchronized` | When an LDAP users attributes have been fully synchronized. Fired on every authentication attempt after the LDAP user has been located. | Onlyfired when using the `DatabaseUserProvider` |
656+
Adldap2-Laravel raises a variety of events throughout authentication attempts.
657+
658+
You may attach listeners to these events in your `EventServiceProvider`:
659+
660+
```php
661+
/**
662+
* The event listener mappings for the application.
663+
*
664+
* @var array
665+
*/
666+
protected $listen = [
667+
668+
'Adldap\Laravel\Events\Authenticating' => [
669+
'App\Listeners\LogAuthenticating',
670+
],
671+
672+
'Adldap\Laravel\Events\Authenticated' => [
673+
'App\Listeners\LogLdapAuthSuccessful',
674+
],
675+
676+
'Adldap\Laravel\Events\AuthenticationSuccessful' => [
677+
'App\Listeners\LogAuthSuccessful'
678+
],
679+
680+
'Adldap\Laravel\Events\AuthenticationFailed' => [
681+
'App\Listeners\LogAuthFailure',
682+
],
683+
684+
'Adldap\Laravel\Events\AuthenticationRejected' => [
685+
'App\Listeners\LogAuthRejected',
686+
],
687+
688+
'Adldap\Laravel\Events\AuthenticatedModelTrashed' => [
689+
'App\Listeners\LogUserModelIsTrashed',
690+
],
691+
692+
'Adldap\Laravel\Events\AuthenticatedWithCredentials' => [
693+
'App\Listeners\LogAuthWithCredentials',
694+
],
695+
696+
'Adldap\Laravel\Events\AuthenticatedWithWindows' => [
697+
'App\Listeners\LogSSOAuth',
698+
],
699+
700+
'Adldap\Laravel\Events\DiscoveredWithCredentials' => [
701+
'App\Listeners\LogAuthUserLocated',
702+
],
703+
704+
'Adldap\Laravel\Events\Importing' => [
705+
'App\Listeners\LogImportingUser',
706+
],
707+
708+
'Adldap\Laravel\Events\Synchronized' => [
709+
'App\Listeners\LogSynchronizedUser',
710+
],
711+
712+
'Adldap\Laravel\Events\Synchronizing' => [
713+
'App\Listeners\LogSynchronizingUser',
714+
],
715+
716+
];
717+
```
667718

668719
### Fallback
669720

0 commit comments

Comments
 (0)