title: Spring Security inmemory authentication issue
body: <p>I am using Spring Security inmemory authentication, but it is not working properly.
  It is generating default password but it is not taking the <strong>user and password</strong> I generated in configuration. Below is my controller:</p>
  
  <pre class="lang-java prettyprint-override"><code>@CrossOrigin(origins = "*")
  @EnableAutoConfiguration
  @RestController
  @RequestMapping("/api")
  public class AppController {
  
       @RequestMapping(value="/hello", method=RequestMethod.GET, produces="text/plain")
       public String sayHello() {
           return "Hello welcome to spring security!!!!";
       }
  }
  </code></pre>
  
  <p>And below is my security configuration class:</p>
  
  <pre class="lang-java prettyprint-override"><code>@Component
  @EnableWebSecurity
  /*@EnableGlobalMethodSecurity*/
  @EnableAutoConfiguration(exclude = { 
          org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class 
      })
  public class SecurityProvider extends WebSecurityConfigurerAdapter {
  
      @Override
      public void configure(HttpSecurity http) throws Exception {
          http
              .authorizeRequests()
                  .antMatchers("/api/*").hasRole("ADMIN")
                  .and()
              .formLogin();
      }
  
      @Autowired
      public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {           
          auth
              .inMemoryAuthentication()
                  .withUser("ramu")
                      .password("password")
                      .roles("ADMIN")
                      .and()
                  .withUser("gopal")
                      .password("password")
                      .roles("USER");
      }
  
      @Bean
      public AuthenticationManager authenticationManagerBean() throws Exception {
          // ALTHOUGH THIS SEEMS LIKE USELESS CODE,
          // ITS REQUIRED TO PREVENT SPRING BOOT AUTO-CONFIGURATION
          return super.authenticationManagerBean();
      }
  }
  </code></pre>
  
  <p>I also tried by excluding <code>SecurityAutoconfiguration.class</code> at main application by using below annonation:</p>
  
  <pre class="lang-java prettyprint-override"><code>@SpringBootApplication(exclude = {SecurityAutoConfiguration.class })
  public class App {
      public static void main( String[] args ) {
          SpringApplication.run(App.class, args);
      }
  }
  </code></pre>
  
  <p>But no luck, it is not taking the username and password I configured in my configuration class.</p>