title: Multiple login using spring security, java config
body: <p>I have multiple logins for my applications. I have defined security filters in two different configurations.</p>
  
  <p>This one has <code>@Order(1)</code> for admin:</p>
  
  <pre class="lang-java prettyprint-override"><code>@Override
      protected void configure(HttpSecurity http) throws Exception {
          http
              .authorizeRequests()
                  .antMatchers("/admin/**")
                  .authenticated()
                  .and()
              .formLogin()
                  .loginPage("/admin/login").defaultSuccessUrl("/admin")
                  .usernameParameter("username").passwordParameter("userpassword")
                  .permitAll()
                  .and()
              .logout().logoutSuccessUrl("/admin/login")
                  .permitAll().and()
                  .csrf();
      }
  </code></pre>
  
  
  
  <p>And other one:</p>
  
  <pre class="lang-java prettyprint-override"><code>@Override
      protected void configure(HttpSecurity http) throws Exception {
          http
              .authorizeRequests()
                  .antMatchers("/tasker/**")
                  .authenticated()
                  .and()
              .formLogin()
                  .loginPage("/tasker/login")
                  .usernameParameter("taskeremail").passwordParameter("taskerpassword")
                  .permitAll()
                  .and()
              .logout().logoutSuccessUrl("/")
                  .permitAll().and()
                  .csrf();
      }
  </code></pre>
  
  
  
  <p>The first one for admin works fine but the second one is not even securing the <code>/tasker/**</code> urls.</p>
  
  <p>Found simular questions but not answerd. Even I could not find anything helpful on spring reference. Please help.</p>