title: How to temporarily disable Spring Security in Spring Web App
body: <p>First, I am a complete noob when it comes to Spring.  An application was left to me to work on by a colleague who is now on vacation.  He told me to leave security alone, as the final approach is not decided yet, and just develop the rest of the application.</p>
  
  <p>However security is enabled and prevents access to the main web page.  I've checked several documents including </p>
  
  <p><a href="https://stackoverflow.com/questions/11227464/disable-spring-security-from-spring-security-xml-file">Disable Spring Security from spring-security.xml file</a></p>
  
  <p><a href="https://stackoverflow.com/questions/25639188/disable-basic-authentication-while-using-spring-security-java-configuration">Disable Basic Authentication while using Spring Security Java configuration</a></p>
  
  <p><a href="http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-security.html" rel="nofollow noreferrer">http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-security.html</a></p>
  
  <p><a href="http://docs.spring.io/spring-boot/docs/current/reference/html/howto-security.html" rel="nofollow noreferrer">http://docs.spring.io/spring-boot/docs/current/reference/html/howto-security.html</a></p>
  
  <p>without finding an answer that works.</p>
  
  <p>I did the following:</p>
  
  <p>Added index.html to &lt;welcome-file-list&gt; in web.xml.  This directs me to the login page which was already included in the package I took over.  So, I figured I could simply disable security.</p>
  
  <p>In the spring security.xml added the attribute security="none".  Now I no longer get the login page.  I get a blank page.</p>
  
  <p>In web.xml disabled </p>
  
  <pre><code>&lt;!--     &lt;filter&gt; --&gt;
  &lt;!--        &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt; --&gt;
  &lt;!--        &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt; --&gt;
  &lt;!--    &lt;/filter&gt; --&gt;
  
  &lt;!--    &lt;filter-mapping&gt; --&gt;
  &lt;!--        &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt; --&gt;
  &lt;!--        &lt;url-pattern&gt;/*&lt;/url-pattern&gt; --&gt;
  &lt;!--    &lt;/filter-mapping&gt;  --&gt;
  </code></pre>
  
  <p>Still get blank page.</p>
  
  <p>I see lots of other advice, but it assumes a lot more Spring knowledge than I currently have.</p>
  
  <p>For example in the 4th link above I see:</p>
  
  <blockquote>
    <p>If you define a @Configuration with @EnableWebSecurity anywhere in
    your application it will switch off the default webapp security
    settings in Spring Boot.</p>
  </blockquote>
  
  <p>I don't know what they mean.  I assume this means to put these annotations on some method somewhere, but I can't believe that this can go ANYWHERE in any java class in the application.  Is there an example of doing this?</p>
  
  <p>Can someone point me in the correct direction?  Thanks.</p>