SEC-978: Add onSuccessfulAuthentication to AbstractPreAuthenticatedProcessingFilter #1230

Closed
spring-issuemaster opened this Issue Sep 17, 2008 · 2 comments

1 participant

@spring-issuemaster

Rory Winston (Migrated from SEC-978) said:

I would like to be able to add specific behaviour on successful authentication. I have a custom filter which is a subclass of AbstractPreAuthenticatedProcessingFilter, and I would like to be able to override or at least extend the behaviour of successfulAuthentication(). Would it be possible to add some kind of template onSuccessfulAuthentication method in the base class that could be called within successfulAuthentication()?

e.g. abstract void onSuccessfulAuthentication(HttpServletRequest request ….. )

within successfulAuthentication():


onSuccessfulAuthentication(request…..);
….

At the moment I cant find a way to override this in my subclasses.

@spring-issuemaster

Luke Taylor said:

You can already override the behaviour of successfulAuthentication since it’s a protected method. Is there some additional requirement that you have? I can’t really see what would prevent you from overriding the behaviour as it stands.

@spring-issuemaster

Luke Taylor said:

I can’t see any requirement for this, given that the current successfulAuthentication method is effectively just:

protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, Authentication authResult) { SecurityContextHolder.getContext().setAuthentication(authResult); if (this.eventPublisher != null) { eventPublisher.publishEvent(new InteractiveAuthenticationSuccessEvent(authResult, this.getClass())); } }

and is already protected.

@spring-issuemaster spring-issuemaster added this to the 3.0.0 M1 milestone Feb 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment