Skip to content

DefaultAuthenticationEventPublisher should allow configuring a default event #7825

Closed
@jzheaux

Description

@jzheaux

DefaultAuthenticationEventPublisher will drop any exceptions that it doesn't have mapped. This means that an application needs to use setAdditionalExceptionMappings to provide any mappings not provided by default.

It would be nice to be able to configure a default event that gets fired for any unmapped exceptions:

DefaultAuthenticationEventPublisher publisher = new DefaultAuthenticationEventPublisher();
publisher.setDefaultAuthenticationFailureEvent(AuthenticationFailureBadCredentialsEvent.class);

With the above configuration, an AuthenticationFailureBadCredentialsEvent would be fired in the event that the published exception doesn't map to anything in DefaultAuthenticationEventPublishers mappings.

DefaultAuthenticationEventPublisher would change at around this point:

if (constructor != null) {
    try {
        event = constructor.newInstance(exception, authentication);
    } catch // ...
}

Where the event gets constructed.

Metadata

Metadata

Assignees

Labels

in: webAn issue in web modules (web, webmvc)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions