The Wayback Machine - https://web.archive.org/web/20250521232149/https://github.com/symfony/symfony/issues/37585
Skip to content

[Security] Pass Passport to LoginFailureEvent #37585

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

Closed
romaricdrigon opened this issue Jul 15, 2020 · 1 comment · Fixed by #37917
Closed

[Security] Pass Passport to LoginFailureEvent #37585

romaricdrigon opened this issue Jul 15, 2020 · 1 comment · Fixed by #37917

Comments

@romaricdrigon
Copy link
Contributor

Description

With the new authenticator-based Security component (5.1+)

When Credentials verification fails, a LoginFailureEvent event is raised.
Currently, its arguments are:
AuthenticationException $exception AuthenticatorInterface $authenticator Request $request ?Response $response string $firewallName

It would be useful to also pass it the Passport whose verification failed.
Typical use case: when a User try to log in with an invalid API key, I would like to store which API key was used. In some scenario, building the Passport from the Request is complex, so having to re-parse the Request is not great.

Extra suggestion; also sending the passport (or null) to onAuthenticationFailure, as right now it won't be stored in AuthenticationException.

@javiereguiluz javiereguiluz changed the title [Security][authenticator][new feature] Pass Passport to LoginFailureEvent [Security] Pass Passport to LoginFailureEvent Jul 18, 2020
@wouterj
Copy link
Member

wouterj commented Aug 15, 2020

👍 Do you have time to work on a PR for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants