title: Spring Security Login with a twist: users must activate their account before login
body: <p>I have implemented spring security to protect sections of our website. I am using a DB (MongoDB) to store username/password. I implemented org.springframework.security.core.userdetails.UserDetailsService to lookup the account details from the DB.</p>
  
  <p>I still need to add another feature: account activation. After registration, we send an activation email to a user and if he clicks on it, we mark the account as activated in the DB. Users that have not activated their account, should not be allowed to log in and should be redirected to a page for that. </p>
  
  <p>Any ideas on how to implement? I need to somehow hook into the login process.</p>
  
  <p>Thanks!</p>