spring-projects / spring-projects/spring-security
Example for customising AuthenticationEventPublisher does not work
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the authentication events documentation page and the DefaultAuthenticationEventPublisher example described in the issue. Check how the default authentication failure event is instantiated and how AbstractAuthenticationFailureEvent is handled. Done means the documented example works and unregistered authentication exceptions resolve to a failure event without an instantiation failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- authentication, documentation, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100