title: Pre-Authentication without Authorization using Spring Security
body: <p>My requirement is:</p>
  
  <p>In my application, the authentication is performed by customized third party API for the first time when the user logs in via login screen(not by using Spring Security). Now, we got few enhancements in which the rest service calls are used. Per the requirement, before making any rest call from our application, we need to reauthenticate the user against the database. Since the user is already validated when he logged in using login screen and those details are available in the request, <strong>I am planning to use spring security for reauthenticating the user(Pre-Authentication scenario).We don't have any roles defined for the users in our application. So no need to worry about the roles.</strong> I have read the reference manual, but I didn't get much info on how to proceed further. One thing I understood is we need to tell the spring context somehow about the user after he is authenticated by customized third party API. Even I have googled a bit around, but could not get a good example that suits my requirement. 
  It would be great if anybody can guide me on how to start with an example.</p>
  
  <p><em><strong>I just need to tell the spring context something like "hey..! this user is already authenticated so he can be permitted to call the rest services after the user's credentials are verified by the customized third party API.</em></strong></p>
  
  <p>I am not supposed to change the existing initial authentication process. I should only use the authenticated user info and use the spring security further to reauthenticate the user.</p>
  
  <p>My issue is some what similar to the issue mentioned in the spring reference manual <a href="http://docs.spring.io/spring-security/site/docs/3.0.x/reference/preauth.html" rel="nofollow">http://docs.spring.io/spring-security/site/docs/3.0.x/reference/preauth.html</a></p>
  
  <blockquote>
    <p>Please don't answer with single line (except if it has a proper
    external link).It would be great if you can show me an example or pseudo code.</p>
  </blockquote>
  
  <p>Thanks in advance.  </p>