title: How to change Login URL in Spring Security
body: <p>I created an API that provides User authentication and it's login operation is handled on default <strong>'/login'</strong> path  by Spring Security.</p>
  
  <p>I want to change this path to <strong>'api/v1/login'</strong>.</p>
  
  <p>this is my security config : </p>
  
  <pre><code>http.cors().and().csrf().disable()
              .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
              .and()
              .authorizeRequests()
              .antMatchers("/h2-console/**/**").permitAll()
              .antMatchers(HttpMethod.POST,"/user/register").permitAll()
              .antMatchers("/user/activate").permitAll()
              .antMatchers("/user/reset-password").permitAll()
              .antMatchers("/user/reset-password").permitAll()
              .antMatchers("/admin/user").hasRole("ADMIN")
              .antMatchers("/roles").permitAll()
              .antMatchers("/user/**").hasRole("USER")
              .and()
              .formLogin().loginProcessingUrl("/api/v1/login")
              .and()
              .exceptionHandling().authenticationEntryPoint(jwtAuthenticationEntryPoint)
              .and()
              .addFilterBefore(new ExceptionHandlerFilter(), UsernamePasswordAuthenticationFilter.class)
              .addFilter(new JwtAuthenticationFilter(authenticationManager()))
              .addFilter(new JwtAuthorizationFilter(authenticationManager(), jwtUserDetailService));
  </code></pre>
  
  <p>I have added this line to change it : </p>
  
  <pre><code>.formLogin().loginProcessingUrl("/api/v1/login")
  </code></pre>
  
  <p>But it is still working under <strong>'/login'</strong> path.</p>
  
  <p>"/api/v1/login" return 404.</p>
  
  <p>Is there any way to change it ?</p>
  
  <p>Spring Boot Version : 2.0.0.RELEASE</p>