Using Spring, how can I manually fire AuthenticationSuccessHandler
===

I want to provide the user an alternative means of logging in with a token. I already handle authenticating the user in the PreAuthenticationFilter class but then I need to fire my AuthenticationSuccessHandler.onAuthenticationSucce ss() which does a super.onAuthenticationSuccess() which fires the method in it's base class of SavedRequestAwareAuthenticationSuccessHandler.

How can I fire the AuthenticationSuccessHandler from my preauthentication filter? I tried setting the authentication of the SecurityContextHolder thinking it would automatically fire off the AuthenticationSuccessHandler but it does not. This is how I tried to do that:

Authentication authentication = new UsernamePasswordAuthenticationToken(Username, Password);
SecurityContextHolder.getContext().setAuthenticati on(authentication);

Unfortunately that doesn't work though. So I need to know how to fire the AuthenticationSuccessHandler from a preauthentication filter.

Thank you!