title: Authentication with custom token in spring boot
body: <p>I need to secure my spring boot application and this is what I have:</p>
  
  <ol>
  <li>A spring boot application which exposes some rest apis.</li>
  <li>A frontend which communicates with the exposed apis.</li>
  <li>A custom auth token which the frontend sends for authentication.</li>
  <li>A database which stores the custom auth tokens.</li>
  </ol>
  
  <p>So, essentially my frontend will send a rest request to my spring boot  application along with the auth token and my spring boot application will query the database to see if the auth token is valid. </p>
  
  <p>This authentication should be available for all the controllers in my spring boot application. Is there a way to do it by default for every rest request without explicitly putting the authentication in each and every controller?</p>
  
  <p>I know about spring boot web security features but there isn't enough information on how to use these with custom tokens. </p>