title: Spring Security login page url parameters
body: <p>I am trying to localize my application which is fairly easy to implement through Spring localization and url params which works fine on every page except for the login page where Spring Security strips the mandatory "lang" parameter and the page defaults to English. I have tried implementing a custom login filter through LoginUrlAuthenticationEntryPoint, overriding determineUrlToUseForThisRequest like so:</p>
  
  <pre><code> @Override
  protected String determineUrlToUseForThisRequest(HttpServletRequest request, HttpServletResponse response,
      AuthenticationException exception) {
  String url = super.determineUrlToUseForThisRequest(request, response, exception);
  return url + "?" + request.getQueryString();
  }
  </code></pre>
  
  <p>However this ends in a permanent redirect loop. Note my spring security config class does in theory allow request params on login page:</p>
  
  <pre><code>http
  .and().formLogin().loginPage("/user").permitAll()
  </code></pre>
  
  <p>but I want to achieve "/user?lang=en" which in current state redirects to "/user" thus "lang" param is ignored. </p>
  
  <p>Thanks in advance for any tips. </p>