title: Spring Security How to check if login form credentials are valid?
body: <p>How to proceed if I want to check if credentials are valid ?</p>
  
  <p>For example, I want to be sure that username is valid (valid email, limited size and so on) so I can display the error to the user before even attempting to authenticate using Spring Security.</p>
  
  <p>1) Make sure credentials are valid before authentication
  2) Authenticate
  3) Rock-n-roll </p>
  
  <p>Btw, I'm using Spring Security 3.1.0 RC.</p>
  
  <p>Thank you in advance for your help,
  Adnan</p>
  
  <p><strong>Update</strong>:
  Actually I'm talking about <strong><em>validation</em></strong>: making sure that  username is in valid email format, or make sure that the passwords is at least 8 characters and so on. 
  Only when I'm sure that it is in "valid" format I will submit it to the Security authentication &amp; authorization else I just want to display the login form again with error message (for example: "password must be at least 8 characters").</p>