Skip to content

Example for customising AuthenticationEventPublisher does not work #16866

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

Open
OrangeDog opened this issue Apr 2, 2025 · 0 comments
Open

Example for customising AuthenticationEventPublisher does not work #16866

OrangeDog opened this issue Apr 2, 2025 · 0 comments
Labels
status: waiting-for-triage An issue we've not yet triaged type: bug A general bug

Comments

@OrangeDog
Copy link
Contributor

Describe the bug
https://docs.spring.io/spring-security/reference/6.4/servlet/authentication/events.html has the following example:

DefaultAuthenticationEventPublisher authenticationEventPublisher =
        new DefaultAuthenticationEventPublisher(applicationEventPublisher);
authenticationEventPublisher.setDefaultAuthenticationFailureEvent
        (AbstractAuthenticationFailureEvent.class);

This does not work, as AbstractAuthenticationFailureEvent is abstract, and attempting to call its constructor throws an InstantiationException, which is silently ignored.

To Reproduce
Follow the directions given in the documentation.

Expected behavior
All authentication exceptions are resolved to a failure event, even if not individually registered.

@OrangeDog OrangeDog added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant