Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security] Allow bubbling of interactive login event as AuthenticatorManager is dispatching it #38660

Conversation

smoench
Copy link
Contributor

@smoench smoench commented Oct 21, 2020

Q A
Branch? 5.1
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

The Symfony\Security\Authentication\AuthenticatorManager:L290 dispatches Symfony\Component\Security\Http\SecurityEvents::INTERACTIVE_LOGIN but it is not allowed for bubbling.

@smoench smoench changed the base branch from 5.x to 5.1 October 21, 2020 14:13
@xabbuh xabbuh added this to the 5.1 milestone Oct 21, 2020
@smoench
Copy link
Contributor Author

smoench commented Oct 22, 2020

Travis failures seems unrelated to this changes.

@wouterj
Copy link
Member

wouterj commented Oct 22, 2020

Hi @smoench! I'm interested to know how you use this interactive login event and why you don't use one of the new login events.

While writing the new system, we discussed the interactive event and found out that it was very inconsistent (and almost to the point of becoming unusable): #33558 (comment) That's why I intentionally left it out and only dispatched it for legacy reasons. My idea was to deprecate this event in 5.3/5.4 (whenever we remove the experimental state from the new system). However, it would be interesting to see if that would result in missing functionality.

@smoench
Copy link
Contributor Author

smoench commented Oct 22, 2020

Hi @wouterj!

I was migrating from a Guard-Authenticator to the new approach. One of my tests has failed because there is a Listener listens on Symfony\Component\Security\Http\SecurityEvents::INTERACTIVE_LOGIN. As the documentation says no word about how to act on interactive logins I was debugging the code. Then I was wondering why the AuthenticatorManager dispatches the interactive login event but my listener doesn't get called. I thought this might be a bug and I provided this PR.

Meanwhile I could migrate my listener to the new LoginSuccessEvent. Thanks!

IHMO the dispatch of Symfony\Component\Security\Http\SecurityEvents::INTERACTIVE_LOGIN could be safely removed as the event is not allowed for bubbling and listeners could only be added via a compiler pass to the firewalls event dispatcher.

@smoench smoench closed this Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants