title: Disable Basic Authentication while using Spring Security Java configuration
body: <p>I am trying to secure a  web application using Spring Security java configuration.</p>
  
  <p>This is how the configuration looks:-</p>
  
  <pre class="lang-java prettyprint-override"><code>@Configuration
  @EnableWebMvcSecurity
  public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
  
      private String googleClientSecret;
  
      @Autowired
      private CustomUserService customUserService;
  
      /*
       * (non-Javadoc)
       * 
       * @see org.springframework.security.config.annotation.web.configuration.
       * WebSecurityConfigurerAdapter
       * #configure(org.springframework.security.config
       * .annotation.web.builders.HttpSecurity)
       */
      @Override
      protected void configure(HttpSecurity http) throws Exception {
  
          // @formatter:off
          http
              .authorizeRequests()
                  .antMatchers(HttpMethod.GET, "/","/static/**", "/resources/**","/resources/public/**").permitAll()
                  .anyRequest().authenticated()
              .and()
                  .formLogin()
                      .and()
                  .httpBasic().disable()
              .requiresChannel().anyRequest().requiresSecure();
          // @formatter:on
          super.configure(http);
      }
  
      @Override
      protected void configure(AuthenticationManagerBuilder auth)
              throws Exception {
          // @formatter:off
          auth
              .eraseCredentials(true)
              .userDetailsService(customUserService);
          // @formatter:on
          super.configure(auth);
      }
  }
  </code></pre>
  
  <p>Notice that I have explicitly disabled HTTP Basic authentication using:-</p>
  
  <pre><code>.httpBasic().disable()
  </code></pre>
  
  <p>I am still getting HTTP Authenticaton prompt box while accessing a secured url. Why?</p>
  
  <p>Please help me fix this.
  I just want to render the default login form that comes bundled.</p>
  
  <p>Spring Boot Starter Version : 1.1.5
  Spring Security Version : 3.2.5</p>
  
  <p>Thanks</p>