title: Apply common logic to every request
body: <p>I am new in Spring boot security.  I have built a spring boot based web app, there are several endpoints exposed to client. </p>
  
  <p>Now, I would like to introduce some security check logic for every request hitting my endpoints. I mean no matter to which endpoint the request is for, the security check logic is common for every request. That means I need to be able to parse the request object.  How can I achieve this by using Spring Boot Security? </p>
  
  <p>e.g. Can I achieve this by creating my custom authentication provider like below? Would this be applied to all requests? How can get the request object?</p>
  
  <pre><code>@Component
  public class CustomAuthenticationProvider implements AuthenticationProvider {
      @Override
      public Authentication authenticate(Authentication authentication) throws AuthenticationException {
           // my security check logic, but how can I get the request object?
      }
  </code></pre>
  
  <p>Or am I completely in a wrong direction to achieve this?</p>