title: How to secure REST APIs in Spring Boot web application?
body: <p>I have two Spring Boot web applications. Both applications have different databases and different sets of users. Also, both applications use Spring Security for authentication and authorisation which works properly.</p>
  
  <p>At any given point I will have one instance of the first application running and multiple instances of the 2nd web application running. </p>
  
  <p>I want to expose REST APIs from 1st web application (one instance running) and be able to use that REST APIs from 2nd web application (multiple instances running). </p>
  
  <p>How do I make sure that REST APIs can be accessed securely with proper authentication and by instances of the 2nd applications only.</p>