title: How do I create a logout with Spring Security?
body: <p>I am trying to find a way just to setup a URL that will logout my user from the system. this is only for testing.  Right now we are using the default login page in spring secuirty</p>
  
  <p>here is my spring-secuirty.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans:beans xmlns="http://www.springframework.org/schema/security"
      xmlns:beans="http://www.springframework.org/schema/beans" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
                          http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                          http://www.springframework.org/schema/security
                          http://www.springframework.org/schema/security/spring-security-3.1.xsd"&gt;
  
  
      &lt;global-method-security pre-post-annotations="enabled" /&gt;
  
      &lt;http use-expressions="true"&gt;
          &lt;intercept-url access="hasRole('ROLE_VERIFIED_MEMBER')" pattern="/ask-union**" /&gt;
          &lt;intercept-url access="hasRole('ROLE_VERIFIED_MEMBER')" pattern="/ask-welfare**" /&gt;
          &lt;intercept-url pattern='/*' access='permitAll' /&gt;
  
          &lt;form-login default-target-url="/ask-union" /&gt;
  
          &lt;logout logout-success-url="/" /&gt;
  
          &lt;session-management session-fixation-protection="newSession"&gt;
              &lt;concurrency-control max-sessions="1"/&gt;
          &lt;/session-management&gt;
  
      &lt;/http&gt;
  
      &lt;authentication-manager&gt;
          &lt;authentication-provider&gt;
              &lt;user-service&gt;
                  &lt;user name="xxxxx@aol.com.dev" password="testing" authorities="ROLE_VERIFIED_MEMBER" /&gt;
                 ser-service&gt;
  
          &lt;/authentication-provider&gt;
      &lt;/authentication-manager&gt;
  &lt;/beans:beans&gt;
  </code></pre>