title: Spring security. How to log out user (revoke oauth2 token)
body: <p>When I want to get logout I invoke this code:</p>
  
  <pre><code>request.getSession().invalidate();
  SecurityContextHolder.getContext().setAuthentication(null);
  </code></pre>
  
  <p>But after it (in next request using old oauth token) I invoke </p>
  
  <p><code>SecurityContextHolder.getContext().getAuthentication();</code></p>
  
  <p>and I see my old user there.</p>
  
  <p>How to fix it?</p>