Skip to content

Example for customising AuthenticationEventPublisher does not work #16866

Open
@OrangeDog

Description

@OrangeDog

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions