title: Spring security authentication based on request parameter
body: <p>The application I'm working on already has Spring Security to handle form based authentication. Now the requirement is to login a user programmatically via an external service <strong>if</strong> a token is found in one of the request parameters.</p>
  
  <p>In other words, if a particular request parameter, say "token", exists, it needs to call an external service with that token to verify if it's a valid token. If it is then the user will be logged in.</p>
  
  <p>I can't figure out how and where to "trigger" or "hook on to" Spring Security to check this parameter and make the verification then authenticate the user when appropriate since there is no login form. I thought there should be something in Spring Security that can be extended or customized to do this?</p>
  
  <p>I looked through Spring Security documentation and wonder if AbstractPreAuthenticatedProcessingFilter is the right thing to start with?</p>