title: Spring login with mongodb
body: <p>I using <strong>spring</strong> with a <strong>mongodb</strong> and <strong>thymeleaf</strong>. My problem is that I don't know how I connect the login query with my user database. I already check the password (with hashing) but I only can query users which are initialized in the </p>
  
  <pre><code>@Override
  public void init (AuthenticationManagerBuilder auth) throws Exception {
      auth.inMemoryAuthentication()
          .withUser("user").password("password").roles("USER");
  }
  </code></pre>
  
  <p>method. Can someone help me?</p>