Comments (3)
I don't know the way to specify a certain dispatcher when use a subscriber. But I have no idea why you need to use a subsciber in a Symfony 6 application while you can use the #[AsEventListener(dispatcher: 'security.event_dispatcher.main')]
attribute. IMO this is the same approach as we've had earlier with event subscribers.
from onelogin-saml-bundle.
@slejnej hi!
Thank you for your question.
It's important to remember that authentication events are security events. So you need to specify correct value for a dispatcher
property of the listener configuration.
For example, if you use this bundle in main
firewall, you should specify security.event_dispatcher.main
as a dispatcher
for your listener.
from onelogin-saml-bundle.
@a-menshchikov Thank you for your response.
Maybe some updates to the README with an example how to use that because tagging for the event
and method
is then not sufficient to create a listener, but it also needs dispatcher: security.event_dispatcher.main
(or firewall used in) defined when wiring.
Subscriber to Nbgrp\OneloginSamlBundle\Event\UserCreatedEvent
is never visible for this event, but same subscriber for CheckPassportEvent::class
is listed.
The code:
use Nbgrp\OneloginSamlBundle\Event\UserCreatedEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Security\Http\Event\CheckPassportEvent;
...
public static function getSubscribedEvents()
{
// return the subscribed events, their methods and priorities
return [
UserCreatedEvent::class => 'onUserCreated',
CheckPassportEvent::class => ['onUserCreated', -1],
];
}
debug output:
"Nbgrp\OneloginSamlBundle\Event\UserCreatedEvent" event
-------------------------------------------------------
------- ----------------------------------------------------------------------------- ----------
Order Callable Priority
------- ----------------------------------------------------------------------------- ----------
#1 Nbgrp\OneloginSamlBundle\EventListener\User\UserCreatedListener::__invoke() 0
------- ----------------------------------------------------------------------------- ----------
"Nbgrp\OneloginSamlBundle\Event\UserModifiedEvent" event
--------------------------------------------------------
"Symfony\Component\Security\Http\Event\CheckPassportEvent" event
----------------------------------------------------------------
------- ------------------------------------------------------------------------------------------- ----------
Order Callable Priority
------- ------------------------------------------------------------------------------------------- ----------
#1 Symfony\Component\Security\Http\EventListener\UserProviderListener::checkPassport() 2048
#2 Symfony\Component\Security\Http\EventListener\UserProviderListener::checkPassport() 1024
#3 Symfony\Component\Security\Http\EventListener\CsrfProtectionListener::checkPassport() 512
#4 Symfony\Component\Security\Http\EventListener\UserCheckerListener::preCheckCredentials() 256
#5 Nbgrp\OneloginSamlBundle\EventListener\User\DeferredUserListener::dispatchDeferredEvent() 0
#6 Symfony\Component\Security\Http\EventListener\CheckCredentialsListener::checkPassport() 0
#7 App\EventSubscriber\SecurityEventSubscriber::onUserCreated() -1
------- ------------------------------------------------------------------------------------------- ----------
from onelogin-saml-bundle.
Related Issues (16)
- After upgrading, got a ServiceNotFoundException HOT 2
- Misleading information about ONELOGIN_CUSTOMPATH HOT 2
- Failed to Load Resources HOT 1
- <request_scheme_and_host> with x-forwarded-prefix
- Deprecation Note in Symfony 6.2 HOT 1
- Is it possible to set returnTo? HOT 2
- Override reply (assertion customer service) doesn't work. HOT 1
- new user created at each connection HOT 5
- User provider: load by SAML attributes? HOT 5
- Multiple idP: restrict email by format HOT 4
- Nbgrp_onlelogin_saml.yaml and .env variables HOT 1
- Multiple IDP use without specifying which one to use on idp side HOT 1
- Routes not working after fresh installation HOT 2
- JIT provisioning and persisting User doesn't change anything in the database HOT 4
- Inject <saml:Subject><saml:NameID> into User-Entity HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onelogin-saml-bundle.