spring-projects/spring-security — pull request #149 by jmcshane (2014-12-02 03:49:17+00:00)
Title: SEC-2548: Publish SwitchUser events after SecurityContextHolder changed

SEC-2548: Publish SwitchUser events after SecurityContextHolder changed

[Associated JIRA](https://jira.spring.io/browse/SEC-2548)

As described in SEC-2548, currently the AuthenticationSwitchUserEvent
is published before the authentication is set in the SecurityContextHolder.
This commit changes the ordering of these two things, the Authentication
object is set in the SecurityContextHolder and then the corresponding
event is published. The event publishing was moved from the
requiresSwitchUser and requiresExitUser into the doFilter method.