title: Logout user in custom event listener
body: <p>For Spring Security, I am required to log out a user in <code>AuthenticationSuccessEvent</code>.  If the user logs in with valid credentials, I want to log out the user based on some constraints.</p>
  
  <p>How can I do this?</p>
  
  <pre><code>@Override
  public void onApplicationEvent(AbstractAuthenticationEvent appEvent) {
      if (appEvent instanceof AuthenticationSuccessEvent) {
          if(Condition true)
          {
              //LOGOUT
          }
      }
  </code></pre>