title: Spring Security simple login page cant login
body: <p>So I am trying to creating simple Login Page with help of the Spring Boot and Security. So what I currently have is custom login page and in memory authentication with one user and role.
  The problem is that when I am entering proper user/password spirng is not authenticating it as valid data, and redirecting me again to login page, but this time with: <code>/login#error</code></p>
  
  <p>On client side I am using thymeleaf.</p>
  
  <p>form snippet:</p>
  
  <pre><code>&lt;form th:action="@{/perform_login}" method="post"&gt;
      &lt;input name="user" placeholder="Username" /&gt; &lt;br /&gt; 
      &lt;input name="pass" placeholder="Password" /&gt; &lt;br /&gt; 
      &lt;input type="submit" value="Login" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Configuration class: </p>
  
  <pre><code>@Configuration
  @EnableWebSecurity
  public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
  
      @Override
      protected void configure(AuthenticationManagerBuilder auth) throws Exception {
          auth.inMemoryAuthentication()//
              .withUser("root").password("root").roles("USER");
      }
  
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          http.authorizeRequests() //
                  .antMatchers("/").hasRole("USER") //
                  .antMatchers("/login*").permitAll().and() //
                  .formLogin() //
                  .loginPage("/login")//
                  .loginProcessingUrl("/perform_login")//
                  .and()//
                  .logout()//
                  .permitAll();
      }
  
  }
  </code></pre>
  
  <p>And controller is simple </p>
  
  <pre><code>@Controller
  @RequestMapping("/login")
  public class LoginController {
  
      @GetMapping
      public String getLoginPage() {
          return "login";
      }
  }
  </code></pre>
  
  <p>Any idea what I am doing wrong?</p>