title: Spring Security with EJBs
body: <p>Since EJB authorization is too limited for my needs I want to use Spring Security together with EJBs. For authentication I want to use Spring Security too. The question is, if I can use the Spring Security context within an EJB.</p>
  
  <p>The scenario:</p>
  
  <ul>
  <li>user communicates with a servlet</li>
  <li>authentication through Spring Security</li>
  <li>servlet communicates with an EJB</li>
  <li>the EJB may communicate with other EJBs</li>
  <li>security check with an EJB interceptor or directly in the EJB method</li>
  </ul>
  
  <p>Will the security context, usually hold in a thread local object, be propagated through the servlet and ejb layer so that I can use it for security checks?</p>