title: Spring boot basic authentication
body: <p>I'm using spring boot security to help me to make authentication...</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
  &lt;/dependency&gt;
  
  
  
  @Configuration
  @EnableWebSecurity
  public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
  
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          http
          .cors().and().csrf().disable().authorizeRequests()
          .anyRequest().authenticated().and().httpBasic();
      }
  }
  </code></pre>
  
  <p>I have a rest service to make login (on my controller) thats a post request that i send email and password and i like to use this service to make the authentication...</p>
  
  <p>But i'm new on spring-boot / java... Can some one help me to make that right way?</p>
  
  <p>Thanks.</p>