title: How to logout User in Spring Security with external call
body: <p>I have a Spring boot application with spring security implemented. User logging and logout successfully working and I am using jdbc to session store.
  Now I just want to implement a new rest end point which is accepting userName of a particular user as a parameter and logout that user.
  Currently I am using follwing class as the logout implentation.</p>
  
  <pre><code>@Component
  public class CustomLogoutHandler extends SecurityContextLogoutHandler {
  
      @Override
      public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
          super.logout(request, response, authentication);
      }
  
  }
  </code></pre>
  
  <p>But <strong>my question is how to use this class or inbuilt Spring logout to logout a user from external request?</strong>
  For session_store I am using following configuration and user sessions are successfully saved in the database.</p>
  
  <pre><code>    #Spring Session
  spring.session.store-type=jdbc
  spring.session.jdbc.table-name= SESSION_TABLE
  </code></pre>
  
  <p>Manually deleting the table entry from the table can be done.And it will logout the user.
  But I want do the logout by following the proper flow of Spring security.</p>
  
  <p>Thanks</p>