Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/1.1' into u1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
a-menshchikov committed Mar 22, 2023
2 parents 5e6ccb1 + f8e9432 commit 36f3c46
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
[OneLogin SAML](https://github.com/onelogin/php-saml) Symfony Bundle.

> This bundle depends on Symfony 6 and newer. <br>
> For older Symfony versions you can use [hslavich/oneloginsaml-bundle](https://github.com/hslavich/OneloginSamlBundle)
> For older Symfony versions you can
> use [hslavich/oneloginsaml-bundle](https://github.com/hslavich/OneloginSamlBundle)
> which this bundle based on.
## Installation
Expand Down Expand Up @@ -395,4 +396,27 @@ and `Nbgrp\OneloginSamlBundle\EventListener\User\UserModifiedListener` that can
need to override the default behavior.

Also, you can make your own listeners for `Nbgrp\OneloginSamlBundle\Event\UserCreatedEvent`
and `Nbgrp\OneloginSamlBundle\Event\UserModifiedEvent` events.
and `Nbgrp\OneloginSamlBundle\Event\UserModifiedEvent` events:

``` php
<?php
namespace App\Security;
use Nbgrp\OneloginSamlBundle\Event\UserCreatedEvent;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;
#[AsEventListener(event: UserCreatedEvent::class, dispatcher: 'security.event_dispatcher.main')]
class UserCreatedListener
{
public function __invoke(UserCreatedEvent $event): void
{
// ...
}
}
```

**Important:** you must specify the `dispatcher` option corresponding the firewall which will
trigger the event (`main` in the example above). Read more
about [Security Events](https://symfony.com/doc/current/security.html#security-events).

0 comments on commit 36f3c46

Please sign in to comment.